bubbysitch
New Member
- Messages
- 1
- Reaction score
- 0
Hello!! I'm pretty new around here so I hope this being my first post isn't bad! I came from the repo. I'm thinking of putting together a PR for a nanosecond time/duration type and wanted to see if its worth it
The plan is a
Why add this?
The KSA changelog mentions moving toward integer nanosecond time for universe time, plus a 64-bit BubbleTime for physics steps. Having a dedicated type in Core gives the whole shebang one shared representation instead of passing raw
What the API would look like:
1. Does
2. Is there an existing testing framework?
3. Is a straight nanosecond
Should be zero new dependencies! I use cloud AI agents as well! I review the output and do the best I can to show my work through excessively (I mean it) rigorous conformance. Nice to meet you all!<3
harriett
The plan is a
readonly record struct backed by a 64-bit signed integer, living in Brutal.Core/Types/ right alongside ByteSize and ElementCount. It'd follow the exact same pattern: a single Value, explicit conversions, and checked on narrowingWhy add this?
The KSA changelog mentions moving toward integer nanosecond time for universe time, plus a 64-bit BubbleTime for physics steps. Having a dedicated type in Core gives the whole shebang one shared representation instead of passing raw
longs or doubles across boundaries. (plus a double starts losing single-nanosecond precision after 2^53 nsWhat the API would look like:
FromSeconds(double)with a clear rounding ruleToSeconds()with a documented error bound- Basic math & comparison:
+,-, unary-, ordering, pluscheckedadd and negate - Constants:
Zero,MinValue,MaxValue
FromSecondsmidpoint rounding behaviorToSecondsround-trip accuracy and where it drifts past 1 ns (sincedoublespacing passes 1 ns at 2^23 seconds, or ~97 days)- Checked overflow on addition and negating
MinValue - Ordering with negative durations
- Rejecting
NaNand infinity
1. Does
Brutal.Core/Types feel like the right pklace for this?2. Is there an existing testing framework?
3. Is a straight nanosecond
long fine, or rather make it generic over the time unit?Should be zero new dependencies! I use cloud AI agents as well! I review the output and do the best I can to show my work through excessively (I mean it) rigorous conformance. Nice to meet you all!<3
harriett