Skip to content

Time

time

A singleton object to track time, delta time, and FPS.

Methods

Name Kwargs Description
update None calculates delta time and fps for the current frame.

Getters

Name ReturnType Description
delta_time / dt float the time difference between the current and last frame.
fps int current frames per second (rounded).
float_fps float precise (non-rounded) frames per second.

Use case

from nevu_ui import *
import pygame

pygame.init()

window = Window((500, 500), title = "time example")

time.update()
time.dt
time.float_fps
from nevu_ui import *
import pyray

window = Window((500, 500), title = "time example", backend = Backend.RayLib)

time.update()
time.dt
time.float_fps

Created with GGen v1.1.0 for nevu_ui v0.7.5