ELAPSED( )
Topic group Related topics Example
Returns the number of seconds elapsed between two specified times.
Syntax
ELAPSED(<stop time expC>, <start time expC> [, <exp>])
<stop time expC>
The time expression, in the format HH:MM:SS, at which to stop timing seconds elapsed. The <stop time expC> argument should be a later time than <start time expC>; if it is not, dBASE Plus returns a negative value.
<start time expC>
The time expression, in the format HH:MM:SS, at which to start timing seconds elapsed. The <start time expC> argument should be an earlier time than <stop time expC>; if it is not, dBASE Plus returns a negative value.
<exp>
Any expression, which causes ELAPSED( ) to calculate hundredths of a second. The format of both <start time expC> and <stop time expC> can be HH:MM:SS.hh.
Description
Use ELAPSED( ) with TIME( ) to time a process. Call TIME( ) at the start of the process and store the resulting time string to a variable. Then call TIME( ) again at the end of the process. Call ELAPSED( ) with the start and stop times to calculate the number of seconds between.
ELAPSED( ) subtracts the value of <start time expC> from <stop time expC>. If <start time expC> is the later time, ELAPSED( ) returns a negative value. Both <stop time expC> and <start time expC> must be in HH:MM:SS or HH:MM:SS.hh format, where HH is the hour, MM the minutes, SS the seconds, and hh is hundredths of a second.
Without <exp>, any hundredths of a second are truncated and ignored; ELAPSED( ) does not round hundredths of a second when <exp> is omitted.