Miscellany
public php v1 · immutable<?php/*** Class for handling multiple timers***/class Timer{ private $times; # Constr function __construct(){ $this->times = array(); } # Start the timer function start($label){ $tmpTime = microtime(TRUE); $this->times[$label]['start'] = $tmpTime; } # Stop the timer function stop($label){ $tmpTime = microtime(TRUE); $this->times[$label]['stop'] = $tmpTime; $this->times[$label]['total'] = $this->times[$label]['stop'] - $this->times[$label]['start']; } };?>