m (bot: correcting title) |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$ticks | + | {{mirc title|$ticks identifier}}'''$ticks''' retrieves the number of [[milliseconds]] that have elapsed since the system was [[uptime|started]]. $ticks is most often used in [[benchmarking]]. |
+ | |||
== Details == | == Details == | ||
Line 5: | Line 6: | ||
== Synopsis == | == Synopsis == | ||
− | + | <pre>$ticks</pre> | |
+ | |||
+ | == Parameters == | ||
+ | None | ||
+ | |||
+ | == Properties == | ||
+ | None | ||
== Example == | == Example == | ||
Line 23: | Line 30: | ||
== Compatibility == | == Compatibility == | ||
{{mIRC compatibility|4.7}} | {{mIRC compatibility|4.7}} | ||
− | |||
− | |||
== See also == | == See also == | ||
Line 37: | Line 42: | ||
* {{mIRC|$asctime}} | * {{mIRC|$asctime}} | ||
* {{mIRC|/noop}} | * {{mIRC|/noop}} | ||
+ | * {{mirc|examples/benchmark}} | ||
{{mIRC identifier list}} | {{mIRC identifier list}} | ||
− | [[Category: | + | [[Category:mIRC identifiers|ticks]] |
Revision as of 16:20, 22 September 2017
$ticks retrieves the number of milliseconds that have elapsed since the system was started. $ticks is most often used in benchmarking.
Details
The $ticks identifier is used to retrieves the current system uptime in milliseconds. The identifier is limited to the resolution of the system timer which is typically in the range of 10 milliseconds to 16 milliseconds. Prior to mIRC version 7.33 the $ticks identifier used the GetTickCount() function which meant the value $ticks returned would wrap around to zero after 49.71 days. In 7.33 the $ticks identifier was switched to use the GetTickCount64() function, eliminating this issue (which wraps around once every 584.9 million years).
Synopsis
$ticks
Parameters
None
Properties
None
Example
; time how long it takes to execute an empty loop 10,000 times. Alias example { var %ticks = $ticks, %x = 10000 while (%x) { dec %x } echo -a 10,000 empty iterations took: $calc($ticks - %ticks) ms. }
Compatibility
Added: mIRC v4.7
Added on: 09 Dec 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also
- List of identifiers
- List of commands
- $ctime
- $timer
- $ctimer
- $time
- $date
- $gmt
- $asctime
- /noop
- examples/benchmark