Use time.Sleep instead of time.After

This commit is contained in:
2015-10-12 01:31:24 +03:00
parent 12de3f78e0
commit aa4c7f526f
+1 -1
View File
@@ -23,7 +23,7 @@ func SleepSortWithTimeout(a []int, timeout time.Duration) []int {
for _, val := range a {
go func(val int) {
<-start
<-time.After(time.Duration(val) * time.Millisecond)
time.Sleep(time.Duration(val) * time.Millisecond)
results <- val
}(val)
}