[PATCH] D25908: [dsymutil] Replace TimeValue with TimePoint

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 08:50:58 PDT 2016


labath added a comment.

The main advantage is that it's a standard solution (TimePoint is just a typedef for std::chrono::time_point<std::chrono::system_clock, ...>), whereas TimeValue is our own hand-rolled implementation, which was added before std::chrono existed.

Apart from that, it gives you type safety wrt. durations and time points (modification time is a time point, a "timeout" value is a duration, the difference of two time points is a duration, etc.) and ability to safely work with and combine values with different precisions (1 second + 10 milliseconds == 1010 milliseconds).


https://reviews.llvm.org/D25908





More information about the llvm-commits mailing list