I need to execute a block every 1 second, but it needs to be in the same thread. This means, from what I understand, that I can't make the use of a timer class.
Is there a way to do what I want?
21 Answer
Create a thread and write a loop like so -
while(true)
{ // do something Thread.sleep(1000);
} 2