Quantcast
Channel: Pixi.js Latest Topics
Viewing all articles
Browse latest Browse all 3978

How to execute every second?

$
0
0

How can I run it every second or every 0.5 seconds?

I try 

const seconds = 0;
app.ticker.add(delta => {
  seconds += 1 / 60;
  if(seconds >= 0.5 ){
    console.log('alert!');
  }
});

There doesn't seem to be a very stable operation.

 


Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>