Revert 279ebd to prevent integer overflow for duration calculation.

The integer math could easily overflow with large number for profile-
auto-profile. To address the Maksym's concern, rounding was added.