From f60aec7f3669d9cd2e099d75b9d4ccd37035da57 Mon Sep 17 00:00:00 2001 From: hovertank3d Date: Fri, 17 Jan 2025 17:31:09 +0100 Subject: implement reset button --- main.go | 5 +++++ templates/index.html | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 7eba79e..b7ae65c 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,11 @@ func main() { log.Fatal(err) } + http.HandleFunc("/reset", func(w http.ResponseWriter, r *http.Request) { + counter.Store(0) + http.Redirect(w, r, "/", http.StatusSeeOther) + }) + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { n := counter.Add(1) payload := struct { diff --git a/templates/index.html b/templates/index.html index 1d75a2c..dd4cb2a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -54,13 +54,15 @@ background-color: rgb(31, 31, 31); } +

LZCNT - Count the Number of Leading Zero Bits


-  # [source code]
+  # [source code]
+  # [reset counter]
   log2lzcnt:                # log2lzcnt({{.Requests}});  
       lzcnt   %rdi, %rdi  
       movq    $63,  %rax  
-- 
cgit v1.2.3