InfluxData.Net icon indicating copy to clipboard operation
InfluxData.Net copied to clipboard

suport time precision of nano-second

Open wsq003 opened this issue 7 years ago • 4 comments

DateTime support Tick which is 0.1 macro-second. This is 10000 times better than milli-second.

Current minimal precision of "ms" is not enough. Please support precision "ns".

wsq003 avatar Mar 20 '18 09:03 wsq003

Will do. :) There was a PR for this, but it introduced unnecessary new classes (duplicates with 2 appended at the end) so I need to rework this and can push it to a new nuget then.

tihomir-kit avatar Mar 20 '18 09:03 tihomir-kit

While work is being done with nanosecond-level precision, it might be beneficial to have a workaround to bridge the gap between tick and nano precision.

After some testing and unsuccessful attempts using ulong and DateTime I'm fairly certain the best way to tackle this gap is to add a secondary integer value bounded between 0-99 to account for the last two digits of nanosecond precision.

Every other attempt I made to have everything managed by a single property either ran into the MaxValue limit of ulong around year 583 or involved System.Numerics.BigInteger. The latter is doable but uncommon enough that it might not be intuitive for most users.

jschmidtWK avatar Mar 28 '18 12:03 jschmidtWK

Would you consider taking a dependency on Noda Time? You could make use of the Instant class throughout this library. Might make things easier in the long run.

chuseman avatar Jun 08 '18 19:06 chuseman

I think I prefer what @jschmidtWK proposed. Introducing NodaTime (although I love it personally) would introduce kinda big-ish breaking changes for many people and I actually want to keep the number of 3rd party dependencies to a minimum.

tihomir-kit avatar Jun 15 '18 09:06 tihomir-kit