use integer to compare times to fix the precision issue.