/**
  * PerformanceSnapshot constructor.
  * @param PerformanceSnapshotInterface|null $prev
  */
 public function __construct(PerformanceSnapshotInterface $prev = null)
 {
     $this->created = Utils::getMicroTime();
     if ($prev instanceof PerformanceSnapshotInterface) {
         $this->timePassed = bcsub($this->creationTime(), $prev->creationTime(), 4);
     } else {
         $prev = new PerformanceSnapshotNullObject();
         $this->timePassed = 0;
     }
     $this->numClassesDeclaredTotal = count(get_declared_classes());
     $this->numFilesIncludedTotal = count(get_included_files());
     $this->numClassesDeclared = $this->numClassesDeclaredTotal - $prev->numTotalClassesDeclared();
     $this->numFilesIncluded = $this->numFilesIncludedTotal - $prev->numTotalFilesIncluded();
     $this->memoryAllocated = round(memory_get_usage() / 1024 / 1024, 4);
     $this->memoryAllocatedDiff = bcsub($this->memoryAllocated, $prev->memoryAllocated(), 4);
 }