From bd27cda49077924f9989a0f1901f49ae9d7dafc6 Mon Sep 17 00:00:00 2001 From: YikesHome <31678324+yikeshome@users.noreply.github.com> Date: Wed, 30 Oct 2019 03:46:27 +0800 Subject: [PATCH] Create profile.go --- profiling/profile.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 profiling/profile.go diff --git a/profiling/profile.go b/profiling/profile.go new file mode 100644 index 0000000..f7beae1 --- /dev/null +++ b/profiling/profile.go @@ -0,0 +1,12 @@ +package profile + +import ( + "time" + "log" +) + +func Duration(invocation time.Time, name string) { + elapsed := time.Since(invocation) + + log.Printf("%s lasted %s", name, elapsed) +}