Click to See Complete Forum and Search --> : Timers


Richcoleuk
03-17-2003, 08:02 AM
I am writing a program that requires a call to a timer every second. I am familiar with visual basic timer, and you just put the event in the timer sub. Is there a similar function in java? how does it work? also is javascript and java the same?

gil davis
03-17-2003, 08:09 AM
Originally posted by Richcoleuk
I am writing a program that requires a call to a timer every second.Javascript has a function called setInterval() that can be used to set a periodic interrupt.var myTimer = setInterval("someFunction()", someMS);where someMS is the interval in milliseconds. To stop the timer, useclearInterval(myTimer);also is javascript and java the same? No. Javascript is a subset of Java that has been tailored for browser implementation. Javascript is an interpreter, whereas Java requires compilation.