Hello all, in line with the "deinventing the wheel" movement, I'd like to remove the TimeValue class from LLDB. I've done some research on a flight this week, and as far as I can tell all functionality can be easily replaced with appropriate usage of std::chrono::duration and time_point.
The only parts that are missing are the ability to convert to/from legacy C types (struct timevalue, struct timespec), which can be replaced by utility functions. Also, I've found one use case particularly cumbersome to write in the c++ way: writing out a duration as a fractional number of units (e.g. milliseconds). So, I'd propose adding the following utility function as well (unless someone knows a cleaner way to write this): template<typename DurOut, typename DurIn> double float_duration(DurIn dur) { return std::chrono::duration_cast<std::chrono::duration<double, DurOut::period>>(dur).count(); } Then, you can write float_duration<milliseconds>(dur) to get the duration as a fractional number of milliseconds (used in printing time deltas in a human readable fashion). Any thoughts or objections? pl
_______________________________________________ lldb-dev mailing list lldb-dev@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev