Skip to content

[examples][core_delta_time] Convert GetFrameTime() to milliseconds before printing - #6201

Merged
raysan5 merged 1 commit into
raysan5:masterfrom
Ne0nWinds:Ne0nWinds/unit-conversion-bug
Oct 1, 2026
Merged

raysan5 merged 1 commit into
raysan5:masterfrom
Ne0nWinds:Ne0nWinds/unit-conversion-bug

Conversation

@Ne0nWinds

@Ne0nWinds Ne0nWinds commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The core_delta_time example has a simple unit conversion bug. GetFrameTime() returns seconds, but the format string in DrawText() says the result is in milliseconds.

The fix is to simply multiply the result of GetFrameTime() by 1000 to convert from seconds to milliseconds.

Repro Steps

The issue can be clearly seen on the web example: https://www.raylib.com/examples/core/loader.html?name=core_delta_time
At 60 FPS, the example reports that the frame time is 0.02ms. After this fix, it says 16.67ms.

@Ne0nWinds Ne0nWinds changed the title [examples][core_delta_time] Convert GetFrameTime() to millseconds before printing [examples][core_delta_time] Convert GetFrameTime() to milliseconds before printing Oct 1, 2026
@Ne0nWinds
Ne0nWinds force-pushed the Ne0nWinds/unit-conversion-bug branch from 0774e32 to d84dd40 Compare October 1, 2026 18:14
@raysan5
raysan5 merged commit 987a0e5 into raysan5:master Oct 1, 2026
17 checks passed
@raysan5

raysan5 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

@Ne0nWinds Good catch! Thanks!

@Ne0nWinds
Ne0nWinds deleted the Ne0nWinds/unit-conversion-bug branch October 3, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants