I am very new to scripting, I have only aptana to check if what i am writing is correct I am adapting a script I found on the net. I have got it doing milliseconds, but what stumped me is that when i tried nanoseconds it didn’t want to know. I’m sure theres a genius out there that could point me in the right direction.
<script language=”JavaScript”>
var clockID = 0;
function UpdateClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
document.theClock.theTime.value = “”
+ tDate.getHours() + “:”
+ tDate.getMinutes() + “:”
+ tDate.getSeconds() + “:”
+tDate.getMilliseconds();
clockID = setTimeout(“UpdateClock()”, 1);
}
function StartClock() {
clockID = setTimeout(“UpdateClock()”, 1);
}
function KillClock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}
//–>
</script>
<body onload=”StartClock()” onunload=”KillClock()”>
<center><form name=”theClock”>
<input type=text name=”theTime” size=12>
how do i do nano’s ? as i said this is not my original work aside from one line, eg milliseconds…
Thank you! i have to go back to college in a week and a half and i’d love to getting nano’s by then! is there a way its done by arithmetic if theres not a nano command.