# Problem Using Phaser.Time.Clock

**URL:** <https://phaser.discourse.group/t/problem-using-phaser-time-clock/1682>\
**Category:** Phaser 3\
**Created:** [March 14, 2019, 6:55am UTC](https://phaser.discourse.group/t/problem-using-phaser-time-clock/1682 "2019-03-14T06:55:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rebenely](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rebenely/32/675_2.png) [@rebenely](https://phaser.discourse.group/u/rebenely)\
**Post date:** [March 14, 2019, 6:55am UTC](https://phaser.discourse.group/t/problem-using-phaser-time-clock/1682/1 "2019-03-14T06:55:20Z")

</div>

I want to get the time elapsed (seconds) in a scene. My idea is to set a variable x to be this.time.now/1000. Then before scene exit, I subtract x from the current time. My problem is that in one scene, it works fine. But in another, when I timestamp on the create method, it gives me a large number. Also, this.time.now/1000 upon exit gives me a rather large value compared to how many seconds have elapsed. I wonder if launching other scenes mess up with its value.

If there are other better ways to do this, I’ll gladly change my code.

Thanks!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [March 14, 2019, 9:51pm UTC](https://phaser.discourse.group/t/problem-using-phaser-time-clock/1682/2 "2019-03-14T21:51:44Z")

</div>

I had this problem and used

```javascript
function init () {
  if (this.time.now > 1e9) {
    console.warn('time.now is too large', this.time.now);
    this.time.update(0, 0);
  }
}

```

---

<div class="post-metadata">

**Author:** ![rebenely](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/rebenely/32/675_2.png) [@rebenely](https://phaser.discourse.group/u/rebenely)\
**Post date:** [March 15, 2019, 2:23pm UTC](https://phaser.discourse.group/t/problem-using-phaser-time-clock/1682/3 "2019-03-15T14:23:45Z")

</div>

I tried doing this too. But there were also problems when I launch other scenes. I opted just to use the javascript Date object for the timestamps.
