Esempio n. 1
0
 public function instant()
 {
     if ($this->tickNanos % 1000000 == 0) {
         $millis = $this->baseClock->millis();
         return Instant::ofEpochMilli($millis - Math::floorMod($millis, $this->tickNanos / 1000000));
     }
     $instant = $this->baseClock->instant();
     $nanos = $instant->getNano();
     $adjust = Math::floorMod($nanos, $this->tickNanos);
     return $instant->minusNanos($adjust);
 }
Esempio n. 2
0
 public function millis()
 {
     return $this->baseClock->millis() + $this->offset->toMillis();
 }