Start or reset a counter to time commands
StopWatch <ApplicationPath> {Start | Reset}
The StopWatch command allows you to time commands or scripts containing commands to determine how long a command or set of commands takes to complete.
This command is used in conjunction with the StopWatchGet command, which returns the data for split timing or allows you to stop the counter.
To start the counter for all subsequent commands until a StopWatchGet Stop command is sent:
StopWatch / Start
If activated, Connect returns an acknowledgement message.
Hint: The commands are typically paired as follows: StopWatch / Reset with StopWatchGet / Split or StopWatch / Start with StopWatchGet / Stop
To time an entire event as well as the elapsed time for a particular portion of an event using the StopWatch / Reset with StopWatchGet / Split combination:
StopWatch / Reset
StopWatchGet / Split
2.5097, 2.5097
Times are returned in seconds (the default) and both times will be the same because the elapsed time since the beginning of the event is the same as the elapsed time for the first portion of the event.
To receive the time that has elapsed between the Split commands and the total time elapsed since Reset based on the previous example:
StopWatchGet / Split HMS
00:00:03.0296, 00:00:05.5393
This StopWatchGet / Split command returns two times--the time since the last StopWatchGet / Split command and the time since the last StopWatch / Reset command.
You can continue to mimic a real stop watch by sending the StopWatchGet / Split command whenever you wish to return the total elapsed time for the event as well as the elapsed time for a particular portion of an event.
Warning: The StopWatchGet / Split command can only be issued after a StopWatch / Reset or another Split command. Connect will NACK if these rules aren't followed.
To return only the total elapsed time spent calculating accesses using the StopWatch / Start with StopWatchGet / Stop combination:
StopWatch / Start
<USER ACTION: Calculate Accesses>
StopWatchGet / Stop HMS
00:00:02.5378
To reset the Start/Stop sequence to 0 and time another user-defined action:
StopWatch / Reset
You would then send:
StopWatch / Start
<USER ACTION: Add, delete objects>
StopWatchGet / Stop HMS
00:00:07.1173
Warning: The StopWatchGet / Stop command can only be issued after a StopWatch / Start command. The StopWatch / Start command can only be issued after a StopWatchGet / Stop or StopWatch / Reset command. Connect will NACK if these rules aren't followed.
This command belongs to the following group(s):
4.0.5
STK Programming Interface 11.0.1