adventofcode/timer.go

28 lines
365 B
Go

package main
import (
"fmt"
"log"
"os"
"strconv"
"time"
)
func main() {
wait := 1
if len(os.Args) > 1 {
wait = Atoi(os.Args[1])
}
time.Sleep(time.Minute * time.Duration(wait))
fmt.Println("Done waiting")
}
func Atoi(i string) int {
var ret int
var err error
if ret, err = strconv.Atoi(i); err != nil {
log.Fatal("Invalid Atoi")
}
return ret
}