espace Posted June 19, 2018 Share Posted June 19, 2018 hi, I'm searching to find how time is falling an object with Phaser.arcade. actually i use : console.time("a") console.timeEnd("a") the problem is that the time is each case different depending by the performance of the browser. i read that i must use performance.now() instead... but i would have an advice about that and find how to determine the time that my object take to fall to the ground... thanks. Link to comment Share on other sites More sharing options...
onlycape Posted June 19, 2018 Share Posted June 19, 2018 Hi @espace, When the object collide "in the air" : var timeStamp1 = performance.now() When the object collides with ground : var timeStamp2 = performance.now() The time the object take to fall to the ground in miliseconds is ----> parseInt ( timeStamp2 - timeStamp1 ) Regards. espace 1 Link to comment Share on other sites More sharing options...
espace Posted June 20, 2018 Author Share Posted June 20, 2018 thanks Link to comment Share on other sites More sharing options...
Recommended Posts