File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -609,6 +609,32 @@ var TimeStep = new Class({
609609 this . step ( window . performance . now ( ) ) ;
610610 } ,
611611
612+ /**
613+ * Gets the duration which the game has been running, in seconds.
614+ *
615+ * @method Phaser.Core.TimeStep#getDuration
616+ * @since 3.17.0
617+ *
618+ * @return {number } The duration in seconds.
619+ */
620+ getDuration : function ( )
621+ {
622+ return Math . round ( this . lastTime - this . startTime ) / 1000 ;
623+ } ,
624+
625+ /**
626+ * Gets the duration which the game has been running, in ms.
627+ *
628+ * @method Phaser.Core.TimeStep#getDurationMS
629+ * @since 3.17.0
630+ *
631+ * @return {number } The duration in ms.
632+ */
633+ getDurationMS : function ( )
634+ {
635+ return Math . round ( this . lastTime - this . startTime ) ;
636+ } ,
637+
612638 /**
613639 * Stops the TimeStep running.
614640 *
You can’t perform that action at this time.
0 commit comments