time - Easiest way to do a millisecond countdown in C? -
What is the easiest way to count the milliseconds in C (minimum: seconds: milliseconds) and display it on the screen can go? To measure the exact time between screenshots, I need to execute the program in CMD prompt window and see the seconds.
# include & lt; Sys / time.h & gt; Straight Timewall SS1, SS2; Ss1.tv_usec; // First timestamp gettimeofday (and ss1, NULL); // Type the screenshot capture code ss2.tv_usec; // Second timestamp gettimeofday (& ss2, NULL);
Note that tv_usec
will give you time in Microsecond and 1 millisecond = 1000 microsounds
.
Check for other similar solutions.
Comments
Post a Comment