I need to implement a timer in my game. how can i do it? I want to do it using dom and jquery if possible.can someone help?
techyworld 0 Junior Poster in Training
Recommended Answers
Jump to Postwindow.setInterval(yourfunctionhere, 10000); function yourfunctionhere() { #do something }
Jump to PostHi techyworld,
Hope this helps:
var intervalID; var gameTimer; // 1000 mS equivalent to 1 second var timeInterval = 1000; gameTimer = function(){ /** ... do anything here ... **/ /** set which should be update etc. **/ }; intervalID = setInterval(gameTimer,timeInterval); /** in case you need …
All 6 Replies
code739 17 Posting Whiz in Training
Biiim commented: spot on +5
code739 17 Posting Whiz in Training
techyworld 0 Junior Poster in Training
JorgeM 958 Problem Solver Team Colleague Featured Poster
gon1387 22 Newbie Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.