Property | Value |
---|---|
Hex Value | $EF02 |
Categories | |
Localizations |
|
checkTmr(
Overview
Returns the number of seconds since you used startTmr
to start the timer. The starttime
is the value displayed by startTmr
.
Availability: Token available everywhere.
Syntax
checkTmr(starttime)
Arguments
Name | Type | Optional |
---|---|---|
starttime |
Location
2nd, catalog, checkTmr(
Description
The checkTmr( command is used together with the startTmr command to determine how much time has elapsed since the timer was started on the TI-84+/SE calculators. In particular, it returns the number of seconds since the built-in timer was started. An application of these commands is timing different commands or pieces of code, as well as countdowns in games, or a time-based score (such as in Minesweeper).
To use the timer, you first store startTmr to a variable (usually, a real variable) whenever you want the count to start. Now, whenever you want to check the elapsed time, you can use checkTmr( with the variable from above, giving you the number of seconds that have passed. Using checkTmr( doesn't stop the timer, you can do it as many times as you want to.
In the case of Minesweeper, for example, you would store startTmr to, for example, T, after setting up and displaying the board, display the result of checkTmr(T) in the game's key-reading loop, and store checkTmr(T) to the player's score if he wins.
Advanced Uses
To time a command or routine using startTmr and checkTmr(, use the following template:
:ClockOn
:startTmr→T
:Repeat checkTmr(Ans
:End
:For(n,1,(number) //sequence variable n
(command(s) to be tested)
:End
:checkTmr(T+1)/(number)
Making (number) higher increases accuracy, but takes longer. Also, make sure not to modify the variables n or T inside the For( loop.
While this method eliminates human error from counting, it's prone to its own faults. For example, startTmr and checkTmr( always return the time rounded down to a whole second. To take this into account, replace the last line:
:(checkTmr(T+{1,0})/(number)
When testing code, be aware that many different things affect the time: the strength of the batteries, the amount of free RAM, and including the closing parenthesis on the For( loop. The last one, in particular, has an impact when using a single-line If statement or one of the IS>( and DS<( commands on the first line inside a For( loop.
Related Commands
Source: parts of this page were written by the following TI|BD contributors: Austin 332000, burr, DarkerLine, Electromagnet8, GoVegan, Kenta Lynn, kg583, lirtosiast, Xphoenix.
History
Calculator | OS Version | Description |
---|---|---|
TI-84+ | 0.01 | Added |