fork(2) download
  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. int main() {
  5. time_t seconds_begin, seconds_end;
  6. struct tm breakdown;
  7.  
  8. breakdown.tm_year = 2004 - 1900;
  9. breakdown.tm_mon = 0; /* january */
  10. breakdown.tm_mday = 14;
  11. breakdown.tm_hour = 23;
  12. breakdown.tm_min = 18;
  13.  
  14. seconds_begin = mktime( & breakdown );
  15.  
  16. breakdown.tm_year = 2016 - 1900;
  17.  
  18. seconds_end = mktime( & breakdown );
  19.  
  20. printf( "%.2f minutes", (seconds_end - seconds_begin) / 60. );
  21. }
Runtime error #stdin #stdout 0.02s 1808KB
stdin
Standard input is empty
stdout
6311520.00 minutes