Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
How does the GLFW time acquirement function differ from Java’s built-in time getters?
glfwGetTime() and System.nanoTime() both claim to provide precision-based time interval management based on the host platform’s highest resolution and accuracy clock.
Naturally, I will only use one of them, so which one should I rely on?
How do they differ, and how do their differences play out in time-sensitive calculations such as a runloop?
Possibly I should use both, but in different contexts?
1 answer
glfwGetTime() returns a double while System.nanoTime() returns a long.
If your calculations are time sensitive, you don't want to use a double - integer math is generally much faster.

0 comment threads