public function handle(BaseCommand $command, $next)
 {
     $this->timer->profiles('CommandRunTimeProfile')->start();
     $response = $next($command);
     $totalTime = $this->timer->profiles('CommandRunTimeProfile')->end()->totalTime();
     $this->logger->log($totalTime, "JobProfiler:" . get_class($command), 'complete');
     return $response;
 }
 public function testJobProfile_profilerRecordsTime()
 {
     $profiler = new TimingProfiler();
     $profiler->profiles('TestProfile')->start();
     usleep(100000);
     //100ms
     $profiler->profiles('TestProfile')->setLap('Lap1');
     usleep(100000);
     //100ms
     $totalTime = $profiler->profiles('TestProfile')->end()->totalTime();
     $lapTime = $profiler->profiles('TestProfile')->timeToLap('Lap1');
     $this->assertGreaterThan(0, $lapTime);
     $this->assertLessThan(0.2, $lapTime);
     $this->assertGreaterThan(0.1, $totalTime);
     $this->assertLessThan(0.3, $totalTime);
 }