Codechange: switch all video drivers to std::chrono for keeping time

On all OSes we tested the std::chrono::steady_clock is of a high
enough resolution to do millisecond measurements, which is all we
need.

By accident, this fixes a Win32 driver bug, where we would never
hit our targets, as the resolution of the clock was too low to
do accurate millisecond measurements with (it was ~16ms resolution
instead).
This commit is contained in:
Patric Stout
2021-02-17 14:46:19 +01:00
committed by Patric Stout
parent d437445c67
commit 25f6851ca1
7 changed files with 44 additions and 101 deletions

View File

@@ -62,9 +62,9 @@ private:
*/
bool edit_box_focused;
uint32 cur_ticks;
uint32 last_cur_ticks;
uint32 next_tick;
std::chrono::steady_clock::time_point cur_ticks;
std::chrono::steady_clock::time_point last_cur_ticks;
std::chrono::steady_clock::time_point next_tick;
int startup_display;
std::thread draw_thread;