-
-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time API discussion for v3 #272
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestions inspired by #265 and previous discussions:
Add
int64_t
versions of all float time values inecs_iter_t
,ecs_world_info_t
,EcsTimer
,EcsRateFilter
and only use the integers for calculationsChange
ecs_time_t
to a typedef ofint64_t
or just useint64_t
struct timeval/timespec
, theseconds
member can beint32_t/int64_t
depending on platform, high resolution clock functions typically return a 64-bit integer in nanosecond resolution.Change
ecs_os_get_time()
into a function returningecs_time_t
Register
ecs_time_t
in flecs-meta?There's also the question of what unit to use, micro- or nanoseconds. With microsecond resolution we would be throwing away precision, most high-resolution clocks have a frequency of <1 us (https://stackoverflow.com/a/53472916/12771788). Nanoseconds require dividing/multiplying with even bigger constants, but it could be argued that defines should be used for constants (
ECS_MS/SEC
?) in either case and the code would look the same.The text was updated successfully, but these errors were encountered: