Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


How to time an event in javascript?

events javascript timing

  • Please log in to reply
 

#1 SmartWeb

SmartWeb

    Senior Member

  • Designer
  • 271 posts

Posted 11 August 2012 - 02:04 PM

JavaScript Timing Events
To time events in JavaScript use the following 2 methods
1.setInterval() :This method will wait for a specific time and then execute the specified function and will continue to execute the function for every time interval.
This is the syntax used : setInterval("javascript function",milliseconds);
to Stop the Execution use the clearInterval() method with the following syntax :
clearInterval(intervalVariable)
2.setTimeout() - : this method will wait for a specific time and then executes the specified function
This is the syntax used:
setTimeout("javascript function",milliseconds);
and again to stop the execution use the clearTimeout() method





Also tagged with one or more of these keywords: events, javascript, timing

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users