Skip to content

Instantly share code, notes, and snippets.

@jacobvosmaer
Created October 24, 2018 10:24
Show Gist options
  • Save jacobvosmaer/2b70d04833219b9bb3c9ae11608ae7e6 to your computer and use it in GitHub Desktop.
Save jacobvosmaer/2b70d04833219b9bb3c9ae11608ae7e6 to your computer and use it in GitHub Desktop.
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))
}
@jacobvosmaer
Copy link
Author

Run with go run blurt.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment