Answers for "c time a program"

C
0

execution time of c program

clock_t begin = clock();

/* here, do your time-consuming job */

clock_t end = clock();
double time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
Posted by: Guest on May-20-2021
2

c language time() function

/*
This function returns the time since 00:00:00 UTC, January 1, 
1970 (Unix timestamp) in seconds
*/
#include <time.h>

time_t now = time(0);
  
// Or
time_t now;
time(&now);
Posted by: Guest on March-27-2022

Code answers related to "C"

Browse Popular Code Answers by Language