/** * Calculate time between two points. * * @param IPoint $point1 Starting point. * @param IPoint $point2 Ending point. * * @return Integer Difference between given points in seconds. */ private function calc_time(\IPoint $point1, \IPoint $point2) { $date1 = $point1->getTime(); $date2 = $point2->getTime(); return $date1->getTimestamp() - $date2->getTimestamp(); }