Create one or more page timers that shows elapsed time when the timer is called.
The timer shows the elapsed time in milliseconds since it was created, or since it was reset.
As default the timer is returned as a formatted string, but it can also be returned as an integer value or as a decimal seconds value.
Works with Lasso 6 and later (maybe also Lasso 5).
Parameters
none
Sample Usage
// create a timer instance
var: 't'=js_timer;
// simulate a lengthy code run
sleep: 1234;
// output the timer as string formatted as "1 234 ms"
$t;
// simulate some more code
sleep: 200;
// output the timer as seconds (decimal value)
$t -> seconds;
// reset the timer
$t -> reset;
// simulate some more code
sleep: 321;
// output the timer as an integer value
$t -> integer;
Source Code
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.