time( )

Returns the amount of time since Pico-8 was last started, as a fractional number of seconds.

The time() function returns the fractional number of seconds since Pico-8 was started.

Note: This uses the built-in number type to represent the number of seconds, which has an upper limit of 32,767. (roughly 9h 6m)

Examples Edit

function _init()
  last = time()

function _update()
  -- (empty update to use game loop)

function _draw()
  if (time() - last) > 10 then
    print("time's up!", 44, 60, 7)

See also Edit

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.