瀏覽代碼

Truncate schedule times to the second.

Rob Figueiredo 13 年之前
父節點
當前提交
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