Created
September 21, 2020 20:04
-
-
Save michaeljdennis/b6085858c4c0cdc30cd8fb2217eed635 to your computer and use it in GitHub Desktop.
Timer
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 ( | |
"io/ioutil" | |
"log" | |
"time" | |
) | |
func main() { | |
for { | |
t := []byte(time.Now().String() + "\n") | |
err := ioutil.WriteFile("./time.txt", t, 0644) | |
if err != nil { | |
log.Fatalln(err) | |
} | |
time.Sleep(time.Second) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment