Browse Source

Truncate schedule times to the second.

Rob Figueiredo 13 years ago
parent
commit
5d2c261c11
1 changed files with 1 additions and 1 deletions
  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