Created
May 6, 2013 11:39
-
-
Save yssk22/5524656 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 ( | |
"log" | |
"syscall" | |
"os" | |
"os/signal" | |
"time" | |
) | |
func loop(s string, wait time.Duration) { | |
for { | |
log.Printf("[%s] foo", s) | |
time.Sleep(wait) | |
log.Printf("[%s] bar", s) | |
time.Sleep(1 * time.Second) | |
} | |
} | |
func main() { | |
d := 2200000 * time.Hour | |
log.Printf("%d", d) | |
go loop("111", d) | |
go loop("222", 1 * time.Second) | |
sig := make(chan os.Signal) | |
signal.Notify(sig, syscall.SIGINT) | |
signal.Notify(sig, syscall.SIGTERM) | |
s := <-sig | |
log.Printf("Exited with %d", s) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
expected
but 222 loop cannot work failed if d is a large value.