This commit is contained in:
Jorijn van der Graaf 2025-11-25 23:36:43 +01:00
commit b41ec7960c
3 changed files with 32 additions and 1 deletions

View file

@ -278,6 +278,13 @@ void WindowWayland::wl_surface_frame_done(void* data, struct wl_callback *cb, ui
#ifdef CRAFTER_TIMING
window->frameEnd = std::chrono::high_resolution_clock::now();
window->frameTimes.push_back(window->totalUpdate+window->totalRender);
// Keep only the last 100 frame times
if (window->frameTimes.size() > 100) {
window->frameTimes.erase(window->frameTimes.begin());
}
#endif
window->lastFrameBegin = start;
}