<?php
// StopWatch.php

class StopWatch
{
	var $start_time;
	var $stop_time;
	var $time_elapsed;
	
	function microtime_float()
	{
		list($usec, $sec) = explode(" ", microtime());
		return ((float)$usec + (float)$sec);
	}
	
	function start()
	{
		$this->start_time = $this->microtime_float();
	}
	
	function stop()
	{
		$this->stop_time = $this->microtime_float();
		$this->time_elapsed = $this->stop_time - $this->start_time;
	}
	
	function timeElapsed()
	{
		return $this->time_elapsed;
	}
}
?>