starttimecheck
TASKNAME

The starttimecheck statement starts a performance monitoring session.


Parameters

This statement has one parameter:

taskname – is the name of the task. If this is omitted the database+procedure name will be used as the task name. Multiple tasks can be running at once, each will be timed independently.


Description

This statement starts a performance monitoring session. During a session, Panorama will record the amount of time (in milliseconds) needed to complete each section of code. The code being tested starts with the starttimecheck statement, ends with the finishtimecheck statement, and uses the timecheck statement at intermediate points. Each of these statements must use the same task name (unless you are timing multiple tasks at once). In this example, the task name is SlowThing.

starttimecheck "SlowThing"
..
.. perform first part of task
..
timecheck "SlowThing","part one complete"
..
.. perform second part of task
..
timecheck "SlowThing","part two complete"
..
.. perform third part of task
..
finishtimecheck "SlowThing"

At the end of the session, Panorama will output the session timing results to the console (the best way to see this is to run Panorama X using Terminal.app). The results from the session above will look something like the this:

TIMED TASK: SlowThing
  00108	part one complete
  00542	🔥 part two complete
  00193	complete
  00843 END TIMED TASK: SlowThing

In this example, the first part of the code took about 1/10th second to complete (108 milliseconds), the second part took about 1/2 second (542 milliseconds), and the last part took about 1/5th second (193 milliseconds). The entire task took 843 milliseconds.

Notice that the second section of the task has a 🔥 emoji after the timing value. This is used to highlight any sections that took a particularly long time. By default this will appear for any section of code that takes more than 1/4th second (250 milliseconds). If you want to change the threshold for when the 🔥 emoji appears, use the settimechecklongtime statement, like this:

settimechecklongtime 1000

This example sets the threshold to one second. (Note: The threshold will remain set until you change it again, or until you quit and relaunch Panorama.)

Note: If the task name is prefixed by //, the name is considered “commented out”. This makes it easy to remove and then restore a performance monitoring session.

starttimecheck "//SlowThing"

The // prefix should only be added to the starttimecheck statement, not timecheck and finishtimecheck. These statements will automatically be ignored if the starttimecheck statement has the “commented out” prefix.


See Also


History

VersionStatusNotes
10.2NewNew in this version.