From aa4c7f526f399e4a072ee823168caa8eafd341e8 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Mon, 12 Oct 2015 01:31:24 +0300 Subject: [PATCH] Use time.Sleep instead of time.After --- sort/sleep_sort.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sort/sleep_sort.go b/sort/sleep_sort.go index d76da2c..d452884 100644 --- a/sort/sleep_sort.go +++ b/sort/sleep_sort.go @@ -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) }