Replies: 2 comments
-
Hello @emorell96 Lack of nanosecond time-source does not prevent you to continue calculationg with nanosecond precision. Moreover, the millisecond time provider is the default for Bucket4j. To get nanoseconds from milliseconds I just multiply milliseconds by 1_000_000. I argue that saving nanosecond precision for #NET port is a good idea because it allows reusing all tests numbers and asserts as is. |
Beta Was this translation helpful? Give feedback.
-
It can be used for fine granular throttling. It is obvious that nanosecond is never used for handling business limits, but when you are having to deal with the development of low-level utilities then nanosecond or microsecond precision can be very useful. In my working routines, I develop a lot of internal libraries and low-level code, so I decided to not restrict the usage of Bucket4j by handling business restrictions only, that is why all math operates at maximum time resolution. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am working on a port of this library to c# but I am faced with a few issues around timer resolution in c# specially that most timers in C# are wall based so their resolution is nowhere near nanosecond level.
So, I was wondering how negatively it would affect the Core of the library if in the port I would change it all to use milliseconds instead, or microseconds.
Why are nanoseconds needed in the first place? Any discussion around this would be appreciated since I could decide better in which direction to port.
Because handling nanoseconds in c# doesn't seem too feasible.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions