I created a method in php like this:`
function start(){
echo"Stopwatch has started.<br/>";
$this->startTime = mktime(date("H"), date("s"), date("m"), date("d"), date("Y"));
$_SESSION["time"] = $this->starTime;
}
function stop(){
echo"stopwatch stopped. <br/>";
$this->endTime = mktime(date("H")-1, date("s"), date("m"), date("d"), date("Y"));
echo"<b>Time Elapsed: </b>, date('H:i:s', $this->endTime-$_SESSION['time'])";
}
} `
my goal is to ask the stopwatch about the duration between start and stop. I have to show the duration, then I could use the stop watch multiple times, where the duration value each time I make it stop and start should be calculated properly. Can someone help me?