[API Proposal]: Add GetElapsedTime(long) #84945
Labels
api-approved
API was approved in API review, it can be implemented
area-System.DateTime
partner-impact
This issue impacts a partner who needs to be kept updated
Milestone
Background and motivation
We've added a useful feature called
TimeProvider.GetElapsedTime(long startingTimestamp, long endingTimestamp)
. However, we've identified another frequently used scenario where users want to calculate the elapsed time from the starting timestamp to the current timestamp. To achieve this, users must currently call:To simplify this process, we propose introducing an overload for GetElapsedTime that allows users to simply call
timeProvider.GetElapsedTime(startingTimestamp)
without having to manually call GetTimestamp() each time they want to calculate the elapsed time.Also, will be consistent with Stopwatch.GetElapsedTime(system-int64)
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: