This is my stopwatch code:
var/script = {"
<!DOCTYPE html>
<html>
<head>
<script>
var Timer = [];
Timer["StopWatch"] = 0;
Timer["LoadingTime"] = 0;
function StartTime(){
Timer["LoadingTimer"] = performance.now();
}
function EndTime(){
Timer["StopWatch"] = performance.now();
var DiffTime = Timer["StopWatch"] - Timer["LoadingTime"];
alert(DiffTime);
}
</script>
</head>
<body>
<button onclick="StartTime()">StartTimer</button>
<button onclick="EndTime()">EndTimer</button>
</body>
</html>
"}
The performance.now is a new javascript feature that outputs the time that has passed since the page loaded. The performance.now is extremely accurate (up to microseconds precision).
My problem is:
How can I start the stopwatch both on my computer number 1 and computer number 2 at the same exact time (using javascript/jquery)?
I thought of setting an UTC based alarm system on both the computers that would start the stopwatch but I am not sure if it is accurate enough...
Thanks in advance