timer.getMilliSecCounter

From Inspired-Lua Wiki
Revision as of 12:16, 25 May 2011 by Adriweb (talk | contribs)
Jump to navigation Jump to search

timer.getMilliSecCounter is a function that is part of the timer functions.

Returns the amount of milliseconds elapsed since last calculator reboot.
In the Computer software emulator, it returns an absolute negative time.

The counter rolls over to zero when it passes 232 milliseconds.

This has been introduced in TI-Nspire OS 3.0 (Changes).


Syntax

timer.getMilliSecCounter()
(No arguments)

Example

theTime = timer.getMilliSecCounter()

Good to know

In order to define a relative time origin, whether it's on calc or in the emulator, this can be an example :

function now()
  local now = timer.getMilliSecCounter()
    if now < 0 then
      now = now + 2^31
    end
  return now
end

See also