W
wanwan
I'm trying to measure the average cycle time for a loop in a thread
similar to this one:
public void run() {
while (true){
[do something]
Thread.sleep(1000);
}
}
I took the measurements at the beginning of the loop 200 times and
found an average of 996ms. How can it be possible!
I need to find out the time for each cycle so to find out how much time
I need the thread to sleep.
Can anyone comment on my odd measurements?
similar to this one:
public void run() {
while (true){
[do something]
Thread.sleep(1000);
}
}
I took the measurements at the beginning of the loop 200 times and
found an average of 996ms. How can it be possible!
I need to find out the time for each cycle so to find out how much time
I need the thread to sleep.
Can anyone comment on my odd measurements?