You can use this javascript stopwatch.
JavaScript Stopwatch[^]
You just need to pass the value from clientside to serverside once you are stopping the watch so that it can be stored on server(if you have to save it in DB)
[EDIT]:- (based on your comments)
Here is a little algorithm:
1. When you have to start the watch get the server time and keep it in session.
2. use javascript to show this time on page.
3. when user goes to another page read the start time again from session and display time accordingly.
4. when user hit stop, take the server time again, get the timespan using session value and store in DB.
P.S. dont know PHP else could have given you the code too.