Просмотр исходного кода

Truncate schedule times to the second.

Rob Figueiredo 13 лет назад
Родитель
Сommit
5d2c261c11
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      schedule.go

+ 1 - 1
schedule.go

@@ -64,7 +64,7 @@ func (s *Schedule) Next(t time.Time) time.Time {
 	// values)
 
 	// Start at the earliest possible time.
-	t = t.Add(1 * time.Second)
+	t = t.Add(1*time.Second - time.Duration(t.Nanosecond())*time.Nanosecond)
 
 	// This flag indicates whether a field has been incremented.
 	added := false