Created
October 24, 2018 10:24
-
-
Save jacobvosmaer/2b70d04833219b9bb3c9ae11608ae7e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"time" | |
) | |
func main() { | |
f, err := os.OpenFile("blurt.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) | |
if err != nil { | |
panic(err) | |
} | |
defer f.Close() | |
log.SetOutput(f) | |
start := time.Now() | |
for i := 0; i < 10000; i++ { | |
fmt.Println("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") | |
} | |
log.Printf("%v", time.Now().Sub(start)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run with
go run blurt.go