From b997cdfa4d130702864a2c7a77237da3f00c2d67 Mon Sep 17 00:00:00 2001 From: Sana Date: Fri, 5 Jun 2026 18:01:11 +0530 Subject: [PATCH] feat: add reset functionality for timer --- index.html | 1 + script.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 0f7fb66..172b182 100644 --- a/index.html +++ b/index.html @@ -24,6 +24,7 @@

Progress: 0% (0/0 tasks completed)

00:00:00

+ diff --git a/script.js b/script.js index ca39a81..51c328b 100644 --- a/script.js +++ b/script.js @@ -86,6 +86,13 @@ function stopTimer() { timer = null; } +function resetTimer() { + clearInterval(timer); + timer = null; + seconds = 0; + updateTime(); +} + function updateTime() { let hrs = Math.floor(seconds / 3600); let mins = Math.floor((seconds % 3600) / 60); @@ -97,4 +104,6 @@ function updateTime() { function pad(num) { return num < 10 ? "0" + num : num; -} \ No newline at end of file +} + +updateTime(); \ No newline at end of file