Solved

millisecond countdown timer

Posted on 2012-04-11
3
1,549 Views
Last Modified: 2012-04-25
I'm trying to create a timer that counts down in years, months, days, hours, minutes, seconds and milliseconds. I've found a few guides online, but they are sort of not easy to understand, or do not do the milliseconds. Can anyone help me do something like this, say, for this friday at 13:30.

so it could read 0y 0m 2d 2h 11m 50ms

and counts down the milliseconds. I would show code to demonstrate that I have actually tried to do this myself, but it all failed so dismally that i'd be embarrassed to.

Thanks for any help!
0
Comment
Question by:hibbsusan
  • 2
3 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
Comment Utility
download the sample code from here and make the changes to include year, month and milliseconds....

http://www.hashemian.com/tools/javascript-countdown.htm
0
 

Author Comment

by:hibbsusan
Comment Utility
Right. I couldn't figure out how to make this one display milliseconds -

Thanks!
0
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
Comment Utility
First Download this js file:-
http://scripts.hashemian.com/js/countdown.js

Next modify the DisplayFormat variable as:-
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds, %%MS%% MilliSeconds.";

Next in coutback method add this line for milliseconds:-
DisplayStr = DisplayStr.replace(/%%MS%%/g, calcage(secs*1000,1,1000));

i hope you will make rest of the changes now...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now