[go-nuts] Re: time.Sleep and sync.WaitGroup strange behavior

2017-01-21 Thread Peter Wang
I run example B both playground and my linux(amd64) node, behavior is different At playground, function A, B, C run immediately, then program end immediately At my linux node, function A, B, C run immediately, but program end after wait 5 seconds I confuse why function A and C never sleep 5 se

[go-nuts] Re: time sub negative

2016-11-25 Thread Peter Wang
you should use Sub function Time include two part. Nanosecond method just return field of nsec. not nanoseconds since from 1970 type Time struct { // sec gives the number of seconds elapsed since // January 1, year 1 00:00:00 UTC. sec int64 // nsec specifies a non-negative nanosecond // offset

[go-nuts] Re: why new file modtime is smaller than current time?

2016-11-24 Thread Peter Wang
It is OS behavior. not Go the minimum resolution for timestamp was one second in ext3 filesytem On Friday, November 25, 2016 at 1:39:35 PM UTC+8, fei@gmail.com wrote: > > package main > > import ( >"os" >"time" >"fmt" > ) > > > func main() { >t1 := time.Now() >fmt.Println(t