<?php

class StopWatch
{
  public $startTime;
  public $times = array();
  public function __construct()
  {
    $this->startTime = microtime(true);
  }
  
  public function elapsed()
  {
    $t = microtime(true);
    $this->times[$t] = $t - $this->startTime;
    return $this->times[$t];
  }
}
