You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestions inspired by #265 and previous discussions:
Add int64_t versions of all float time values in ecs_iter_t, ecs_world_info_t, EcsTimer, EcsRateFilter and only use the integers for calculations
Change ecs_time_t to a typedef of int64_t or just use int64_t
There doesn't appear to be much use of it being an analog of struct timeval/timespec, the seconds member can be int32_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 returning ecs_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:
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: