Skip to content

Use nanoseconds for Instant and Duration

Yorick Peterse requested to merge nanos-clock into master

This removes the need for using floating point operations and allocations, making it easier and cheaper to pass times/durations to the VM. Operations such as adding a Duration to an Instant are now also more reliable/consistent, as they're no longer susceptible to floating point rounding errors.

The limitation is that we can only represent durations/monotonic clocks that span up to 292 years, but this should prove more than sufficient for 99.99% of all use cases of these types.

Edited by Yorick Peterse

Merge request reports