tokiwa-software / fuzion

The Fuzion Language Implementation
https://fuzion-lang.dev
GNU General Public License v3.0
47 stars 11 forks source link

give guarantees for `time.nano`? #2593

Open michaellilltokiwa opened 7 months ago

michaellilltokiwa commented 7 months ago

The name nano makes it seem like it gives nano-second precision or resolution. But this is not necessarily the case.

fridis commented 7 months ago

It is a matter of accuracy vs. precision. System functions like nanosleep typically have a very high precision but may have horrible accuracy (i.e. running out of sync with wall clock time by seconds or minutes per day), while sleep or time usually has poorer precision but high accuracy. I had chosen nano in the name to make clear that this is the high precision timer since this seems to be the standard term.

michaellilltokiwa commented 7 months ago

There are comments in time.nano that state that "no guarantee can be given for precision nor resolution". Maybe we then do want to give some guarantee for the default handler?