#include #include /* https://www.cprogramming.com/tutorial/c/lesson3.html https://www.cprogramming.com/tutorial/printf-format-strings.html http://man7.org/linux/man-pages/man3/clock.3.html */ int main() { int i = 1; int sec = 0; while ( i < 6 ) { sec = (int)( clock()/CLOCKS_PER_SEC ); // get program time/ convert to seconds as integer if ( sec == i ) { printf("while loop %d, time %d\n",i,sec ); i++; } } return 0; }