Skip to content

Commit 4b89269

Browse files
authored
Merge pull request #5494 from kodenook/develop
Reto #24 - go
2 parents e84e33a + f6fb004 commit 4b89269

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"time"
6+
)
7+
8+
func main() {
9+
timeTrack(func() { fmt.Println("Hello, Go") })
10+
}
11+
12+
func timeTrack(callback func()) {
13+
start := time.Now()
14+
15+
callback()
16+
17+
fmt.Printf("time: %v", time.Since(start))
18+
}

0 commit comments

Comments
 (0)