fork download
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <unistd.h>
  5.  
  6. using namespace std;
  7.  
  8. int main(int argc, char** argv) {
  9. clock_t start = clock();
  10.  
  11. sleep(3); // seconds
  12.  
  13. clock_t end = clock();
  14.  
  15. printf("process time spent: %lf s\n", (end - start) * 1.0 / CLOCKS_PER_SEC);
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
process time spent: 0.000010 s