Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding milliseconds 1

Status
Not open for further replies.

sle2002

Technical User
Jul 16, 2001
79
US
Hello -

Does anyone know how to add milliseconds to this timer? It displays the time in minutes and seconds but I want to add milliseconds if possible, any help would be greatly appreciated.

My code below works fine - I just want to add milliseconds.

thanks


onClipEvent (load) {
timer = "00:00";
counting = false;
startTimer = function () { counting = true;baseTime = getTimer();};
}
onClipEvent (enterFrame) {
if (counting) {
time = Math.round((getTimer()-baseTime)/1000);
seconds = time%60;
minutes = Math.floor(time/60);
secs = (seconds<10) ? "0"+seconds : seconds;
timer = "0" +minutes+":"+secs;
}
}
 
Is this something I can integrate into my existing code?
 
Hey Audiopro - your code worked great!!! Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top