Jump to content
Search Community

Stopwatch with milliseconds

friendlygiraffe test
Moderator Tag

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm not near my computer right now:

 

But this might give you some ideas using onUpdate instead onRepeat. And uses toFixed():

 

This example uses a onUpdate callback to animate the elapsed time

 

See the Pen ytwdm by jonathan (@jonathan) on CodePen

 

This example uses a onUpdate to animate the progress

 

See the Pen keEyq by jonathan (@jonathan) on CodePen

 

:)

  • Like 2
Link to comment
Share on other sites

I'm not near my computer right now:

 

But this might give you some ideas using onUpdate instead onRepeat. And uses toFixed():

 

This example uses a onUpdate callback to animate the elapsed time

 

See the Pen ytwdm by jonathan (@jonathan) on CodePen

 

This example uses a onUpdate to animate the progress

 

See the Pen keEyq by jonathan (@jonathan) on CodePen

 

:)

Great thanks. Used a combination of ticker and toFixed():

 

Thanks for your help

Link to comment
Share on other sites

  • 2 months later...

Hi all,

 

I came across this while looking for a JavaScript code to create a stopwatch with milliseconds. This was exactly what I was looking for, but I cannot seem to get the code running for me. I have very little programming skills and I only understand the very basics of HTML and JavaScript. I do not know how to change the CSS code to reflect any of these other two formats. 

 

I am looking for help with this exact code but with a few additional add-ons that will allow me to pause the count when a mouse is clicked and save the output. Can anyone please help me?

 

Thank you. 

 

Kindest regards, 

 

Michael 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...