# clock.Timer

moderngl_window.timers.clock.Timer

  Timer based on python `time`.

## Methods

Timer.__init__(**kwargs)

Timer.next_frame() → Tuple[float, float]

  Get the time and frametime for the next frame. This should only be called once per frame.

  Returns:

    current time and frametime

  Return type:

    Tuple[float, float]

Timer.start()

  Start the timer by recoding the current `time.time()` preparing to report the number of seconds since this timestamp.

Timer.pause()

  Pause the timer by setting the internal pause time using `time.time()`

Timer.toggle_pause()

  Toggle the paused state

Timer.stop() → Tuple[float, float]

  Stop the timer. Should only be called once when stopping the timer.

  Returns:

    Current position in the timer, actual running duration

  Return type:

    Tuple[float, float]

## Attributes

Timer.is_paused

  The pause state of the timer

  Type:

    bool

Timer.is_running

  Is the timer currently running?

  Type:

    bool

Timer.time

  Get or set the current time. This can be used to jump around in the timeline.

  Returns:

    The current time in seconds