Calculate intervals more precisely.
Support setting time.