Workshop › Zelda-style Dungeon › Step 18 of 22
The goal is to escape as fast as you can, so frames are counted and shown as seconds in the top right.
```js
let frames
frames = 0
frames += 1
ctx.textAlign = 'right'
const seconds = (f) => (f / 60).toFixed(1)
ctx.fillText('Time ' + seconds(frames), canvas.width - 12, 30)
```toFixed(1) keeps one digit after the dot.seconds is a small arrow function made right where it is needed.held, write frames; in reset, set it to 0 after swing; at the top of update, add one.Skills: Game states, The game loop