FUNCTIONS CORE

SecondsCPU()

Return the CPU time used by the current process

Syntax

Signature
SecondsCPU( [nWhichTime] ) --> nSeconds

Arguments

nWhichTime

Example

SecondsCPU.prg
PROCEDURE Main()

   Check( 'SecondsCPU() >= 0    ', SecondsCPU() >= 0, .T. )
   Check( 'SecondsCPU( 1 ) >= 0 ', SecondsCPU( 1 ) >= 0, .T. )
   Check( 'SecondsCPU( 2 ) >= 0 ', SecondsCPU( 2 ) >= 0, .T. )

RETURN

STATIC PROCEDURE Check( cTitle, xResult, xExpected )

   QOut( cTitle + IIF( xResult == xExpected, "OK", "ERROR" ) )

RETURN

Output

SecondsCPU() >= 0    OK
SecondsCPU( 1 ) >= 0 OK
SecondsCPU( 2 ) >= 0 OK