Reputation: 1043
I'm trying to use the Timespan class to create a start time and a stop time, get the difference and ultimately dividing and multiplying the result against another number.
The problem is getting into something I can work with.
Any suggestions?
Upvotes: 1
Views: 6843
Reputation: 17216
If you're trying to measure code running time, the stopwatch class might be more appropriate.
Upvotes: 4
Reputation: 20069
The TimeSpan class has a number of members which might be able to assist, for instance TotalSeconds, TotalMinutes, TotalHours etc.
If you want to know the number of operations per second, divide the number of operations by the TotalSeconds member of the TimeSpan object.
Upvotes: 9