Using the >StopWatch Meta Command

The stopwatch meta command outputs the elapsed time of a Mentor run in minutes and seconds.

The old format was: CPU time: 122 seconds

The new format is: total time: 2 minutes 2 seconds


Each Mentor run has one stopwatch command build into it. This is what prints the line “total time: n minutes n seconds” at the end of each Mentor run.

The first >stopwatch command in a Mentor run reports the elapsed time of the run up to the >stopwatch command. Subsequent >stopwatch commands, including the final built in command, will print total time elapsed up to that >stopwatch command, followed by, in parenthesis, the time elapsed since the last >stopwatch command.


Thus a run having several >stopwatch commands in it might display the following times:

total time: 0 minutes 31 secondstotal time: 0 minutes 52 seconds (and for part 2, 0 minutes 21 seconds)total time: 1 minutes 2 seconds (and for part 3, 0 minutes 10 seconds)total time: 1 minutes 7 seconds (and for part 4, 0 minutes 5 seconds)


If the last command in a Mentor run is a >stopwatch command, the time displayed in parenthesis by the built in >stopwatch command will be 0 minutes 0 seconds since no time will have elapsed between the >stopwatch command and the ~end statement.

Example Spec:

~comment&stopwat.doc>system sleep 30>stopwatch>system sleep 20>stopwatch>system sleep 10>stopwatch>system sleep 5~end