ELAPSED example
The following example shows a top-level routine that calls processes records. A subroutine does the processing, and returns the number of records processed. The elapsed time is used to calculate the throughput of a process.
local cTimeStart, nRecs, nRecSec, cMsg
cTimeStart = time(1)
nRecs = processRecords()
nRecSec = nRecs / elapsed(time(1), cTimeStart, 1)
cMsg = ltrim(str(nRecs)) + " records processed, " + ;
ltrim(str(nRecSec)) + " records/sec"
msgbox(cMsg, "Process complete")
Note that both the TIME( ) and ELAPSED( ) functions use the optional dummy parameter to return and calculate the time to the hundredth of a second.