Fix long-int overflow when calculating number of microseconds elapsed