Time.bigIntNanoseconds constructor

Time.bigIntNanoseconds(
  1. BigInt bigNanoseconds
)

Implementation

factory Time.bigIntNanoseconds(BigInt bigNanoseconds) {
  // todo: this clamps -- should we test for overflow?
  var milliseconds = (bigNanoseconds ~/ TimeConstants.nanosecondsPerMillisecondBigInt).toInt();
  var nanoseconds = bigArithmeticMod(bigNanoseconds, TimeConstants.nanosecondsPerMillisecondBigInt).toInt();
  return Time._untrusted(milliseconds, nanoseconds);
}