I was expecting this to print the number of seconds since the program started running, over and over again for 10 seconds. Instead, it takes much longer than 10 seconds, and sometimes I can see the numbers speeding up or slowing down during execution.
Why is this? Does it only count the clock cycles that this application is using? Is there a better way to keep track of elapsed time regardless of CPU usage?
Also, the resolution is only hundredths of seconds. After the second decimal place it prints all zeroes. How can I get milliseconds or even finer resolution?