watch start, watch stop, watch continue, watch reset, watch read
watch start | Returns previous time, resets and starts the watch |
watch stop | Returns the time and stops the watch. |
watch continue | Returns the time and lets the watch continue to run |
watch reset | Returns the time and resets the watch. If the watch was continuing before, then it will continue from zero. |
watch read | Returns the time. No push-button actions on the watch. |
Indirect parameter passing is disabled
Windows uses wall clock time. Pause applications to measure true performance.
LINUX and MACOS uses actual CPU processing time.
0
Type | Description |
---|---|
numeral | Stopwatch time in milliseconds elapsed The watch time will be returned before the indicated action will happen. E.g. watch reset returns the time before the reset operation. |
watch start;
sleep (0.05); // 50 ms
echo( "Started: ", watch read(), " ms" );
sleep (0.05);
echo( "Before resetting: ", watch reset() );
sleep (0.05);
echo( "Before stopping: ", watch stop() );
sleep (0.05);
echo( "Before continuing: ", watch continue() );
sleep (0.05);
echo( watch stop(),", ", watch reset(), " and now back at zero: ", watch reset() );
Started: 64 ms
Before resetting: 125
Before stopping: 62
Before continuing: 62
125, 125 and now back at zero: 0