User guide

26-7
26.2.1 Timed Iterations
Iterationsofaprogramcanbetimedwiththeuseofthehsecfunctioninthefollowing
manner.
et = hsec; // Start timer
/* Segment of code to be timed */
et =(hsec-et)/100; // Stop timer, convert to seconds
Inthecaseofaprogramrunningfromonedayintothenextyouwouldneedtoreplace
thehsecfunctionwiththedatefunction.Theethsecfunctionshouldbeusedto
computethetimedifference;astraightsubtractionasinthepreviousexamplewillnot
givethedesiredresult.
dstart = date; // Start timer
/* Segment of code to be timed */
dend = date; // Stop timer
// Convert time difference to seconds
dif = ethsec(dstart,dend)/100;
Time and Date