1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-09-16 09:44:19 +00:00
QB64-PE/internal/c/libqb/include
Matthew Kilgore f21ce09e2d Replace time() with std::chrono, fix startup delay
Currently main() includes logic that is intended to sync time() with
GetTicks() for the purpose of using GetTicks() to get millisecond
accuracy with time(), which only has second accuracy. Unfortunately, the
'syncing' up of these time sources results in an average of a half
second delay in starting a QB64-PE program.

This logic is easly replaced with std::chrono, which provides a real
time clock which is also millisecond accurate. That removes the need to
use time() and GetTicks() together to get millisecond accuracy, and
means the delay syncing them is no longer necessary.

I also separated most of the "delay" and "time" related functions into
datetime.cpp, and included the new std::chrono code into that file.

Since I needed to call some of the rounding functions in datetime.cpp I
also moved that stuff out into its own .cpp and header files to clean
things up a bit.

Fixes: #282
2023-01-08 20:24:25 -05:00
..
audio.h Rename _NEWSOUND to _SNDNEW to align with _SND* APIs 2022-12-31 12:00:38 +05:30
buffer.h Add append-only buffer API 2022-06-11 22:47:06 -04:00
completion.h Add completion API 2022-06-11 22:47:06 -04:00
condvar.h Add generic thread, mutex, and condvar API 2022-06-11 22:47:06 -04:00
datetime.h Replace time() with std::chrono, fix startup delay 2023-01-08 20:24:25 -05:00
event.h Replace time() with std::chrono, fix startup delay 2023-01-08 20:24:25 -05:00
filepath.h Revert changes to miniaudio.h, move changes elsewhere 2022-09-08 23:59:19 -04:00
glut-thread.h Fix random seg faults on exit 2022-11-29 20:04:54 -05:00
gui.h Include stdarg.h in gui.h 2022-10-25 04:34:41 +05:30
http.h Add _StatusCode command for HTTP handles 2022-11-20 04:04:02 -05:00
image.h Update test license files 2022-10-25 07:28:35 +05:30
keyhandler.h Move GLUT initialization logic into separate .cpp file 2022-11-29 20:04:53 -05:00
libqb-common.h Fix High-DPI awareness on Windows 2022-08-28 21:44:07 -04:00
mutex.h Add generic thread, mutex, and condvar API 2022-06-11 22:47:06 -04:00
rounding.h Replace time() with std::chrono, fix startup delay 2023-01-08 20:24:25 -05:00
thread.h Add generic thread, mutex, and condvar API 2022-06-11 22:47:06 -04:00