session_start();
if(isset($_GET['stop'])) {
echo '<h3>' . (time() - $_SESSION['time']) . ' sec</h3>';
unset($_SESSION['time']);
}
if(isset($_GET['start'])) {
$_SESSION['time'] = time();
}
echo isset($_SESSION['time']) ? '<a href="?stop">stop</a>' : '<a href="?start">start</a>';