utilities for getting elapsed times and aligning to a frequency
alternate implementation fro truncate