3 ms·
Also note that these are zero runtime overhead: they act at compile-time through the type system and type-check or add in multiplications when conversions need
by ChrisRackauckas 7y ago
Also note that these are zero runtime overhead: they act at compile-time through the type system and type-check or add in multiplications when conversions need to occur, but the compiled code is just floating point operations without reference to units or unit checking. It's a great system since it means you can always use units, even in performance critical code.
And it works throughout the ecosystem, so you can even use it in linear algebra and things like ODE solves. Here's an example of solving an ODE with units:
https://tutorials.juliadiffeq.org/html/type_handling/03-unitful.html https://tutorials.juliadiffeq.org/html/type_handling/03-unit...