private function getTimeSlice($time = null, $offset = 0) { return (int) floor($time / $this->period) + $offset * $this->period; }