A very very common desire is to get a TimeDuration representing the time since process creation. (Or since any fixed point in time, but that's as good as we have.) double t = (TimeStamp::Now() - TimeStamp::ProcessCreation()).ToMilliseconds(); wouldn't be too bad, except that ProcessCreation requires you to pass in a bool outparam to check whether the creation time is "inconsistent". Which is an important thing to know, but none of the users can do anything about it, and the only one that cares is the telemetry probe that reports on it. If you search the tree, every other caller is using a junk bool like 'ignore'. Why fight it? Make it a separate accessor or an optional ProcessCreation(bool* isInconsistent = nullptr) or something. Alternatively, all of my uses could be satisfied by TimeDuration DurationSinceProcessCreation(); API. Most uses in the tree could probably go through this too, but sometimes there's a better 'now' value lying around, and sometimes the caller wants NowLoRes for performance. And I wasn't sure where to put it -- on BaseTimeDuration, but then it couldn't return a TimeDuration? Or on TimeStamp, which seems a little weird? It is perhaps not general enough.
Summary: TimeStamp::ProcessCreation is annoying to use → TimeStamp::ProcessCreation has annoying required bool& outparam
Status: NEW → RESOLVED
Last Resolved: 11 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1358320
You need to log in before you can comment on or make changes to this bug.