[API-Design] Flexible time intervals.

Close #1212.