time — tracking elapsed time

The time module is used for tracking elapsed time. import utime for the standard python time module.

Functions

time.ticks()

Returns the elapsed milliseconds since power on.

Note

Use the pyb.millis() instead of this function.

time.sleep(ms)

Sleeps for ms number of milliseconds.

Note

Use the pyb.delay() instead of this function.

Constructors

class time.clock

Returns a clock object.

Methods

clock.tick()

Starts tracking elapsed time.

clock.fps()

Stops tracking the elapsed time and returns the current FPS (frames per second).

Always call tick first before calling this function.

clock.avg()

Stops tracking the elapsed time and returns the current average elapsed time in milliseconds.

Always call tick first before calling this function.

clock.reset()

Resets the clock object.