<!DOCTYPE html>
<!--by Pinus-->
<html>
<head>
<title>Системное время</title>
<style type="text/css">
.TextFieldTime{
font-size: 30pt;
}
</style>
<script language="JavaScript">
<!--
var timerFunc1;
var timerFunc2;
var Started = false;
function updateClock(){
today = new Date();
window.document.all.OurClock.value=today.getHours()+':'+today.getMinutes()+':'+today.getSeconds();
}
function updateMilliseconds(){
today = new Date();
window.document.all.timer1.value=today.getMilliseconds();
}
function setOutTimer(){
if(!Started){
timerFunc1 = window.setInterval("updateClock();", 100);
timerFunc2 = window.setInterval("updateMilliseconds();", 11);
}
Started = true;
}
function stopClock(){
window.clearInterval(timerFunc1);
window.clearInterval(timerFunc2);
Started = false;
}
-->
</script>
</head>
<body onload="updateClock();">
<input type="text" size="8" name="OurClock" class="TextFieldTime"></input><input type="text" name="timer1" value="1" size="5"></input><input type="button" value="Start" onClick="setOutTimer();"></input><input type="button" value="Stop" onClick="stopClock();"></input>
</body>
</html>
ONLINE: Часы на JavaScript с миллисекундами
Часы на JavaScript с миллисекундами. Две кнопки - Cтарт и Cтоп. Работает в Opera, Internet Explorer, Chrome.
