Either starts or ends a timer for measuring the accumulated time in CPU seconds used since the beginning of the process execution.
If the endFlag is 0, then the timer is started and the current cpu runtime is returned. If the endFlag is 1, then the timer is stopped and the cpu time since the last timer start is returned.
Note: | The time is returned in seconds. |
Format
TIMER_CPU(endFlag) returns REAL
Argument
endFlag | If the endFlag is 0, then the timer is started and the current elapsed CPU is returned.
If the endFlag is 1, then the timer is stopped and the elapsed CPU time since the last timer started is returned. |
Example
variable set variable=mycpu real=(eval(timer_cpu(0)))
file command read file=mybidcmdfile
variable set variable=mycpu real=(eval(timer_cpu(1)))
variable set var=foo string=(eval(str_print("file read took " //mycpu//"cpuseconds")))