Skip to content

Commit

Permalink
Print time it takes to sign.
Browse files Browse the repository at this point in the history
  • Loading branch information
abourget committed Jun 16, 2018
1 parent 9b26f49 commit 57eef82
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"log"
"net/http"
"time"

"os"

Expand Down Expand Up @@ -78,6 +79,7 @@ func main() {
})

http.HandleFunc("/v1/wallet/sign_digest", func(w http.ResponseWriter, r *http.Request) {
t0 := time.Now()

var inputs []string
if err := json.NewDecoder(r.Body).Decode(&inputs); err != nil {
Expand Down Expand Up @@ -110,10 +112,11 @@ func main() {
w.WriteHeader(201)
err = json.NewEncoder(w).Encode(signed)
if err != nil {
fmt.Println("encoding error:", err)
fmt.Printf("encoding error: %s", err)
} else {
fmt.Println("done")
fmt.Printf("done")
}
fmt.Printf(" (%d us)\n", time.Now().Sub(t0)/time.Microsecond)
})

address := "127.0.0.1"
Expand Down

0 comments on commit 57eef82

Please sign in to comment.