$ticks

From Scriptwiki
Revision as of 20:56, 26 November 2005 by Doomie (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns the number of ticks since your operating system was first started.

$ticks

Note that you can use this as milliseconds, as one tick is one millisecond.

Example

; You can use $ticks to calculate the time a script did need.
; lets make a new alias called testtime
alias testtime {
 ; at first, we need to save the current $ticks
 var %ticks = $ticks, %i = 1, %test
 ; lets "increase" %test 1000 times with the help of a while loop 
 while (%i <= 1000) {
  %test = $calc(%test + 1)
  inc %i
 }
 ; now we can echo the time this script did need by calculating the current $ticks minus the one we have saved in %ticks. 
 echo -a This took: $calc($ticks - %ticks) milliseconds.
}