Round Off - An Hour has 3600 seconds, sometime I get 3559, sometime 3601

  • Thread starter Thread starter KeanHeng
  • Start date Start date
K

KeanHeng

Guest
Hi guys

I'm measuring 3 different Process Time in an Hour.

Total up of 3 different Process Time should has 3600 seconds.


But the things is sometime I get 3601 or 3559 total up, not every time.

What did I did wrong?

// Jam Time
startJamTime= clock();

stopJamTime = clock();

double diff = ( stopJamTime - startJamTime ) / (double)CLOCKS_PER_SEC; // in seconds


// Idle Time



// Round off, any better way to round off?
stPerHourSummary.csDown.Format("%.0lf", m_dMachineTime[DOWN]);

// Total time in an Hour should be 3600 seconds
An hour total = Idle Time + Jam Time

Continue reading...
 
Back
Top