Created
April 9, 2020 19:07
-
-
Save cjvandyk/666c276ea2920039872ef311f1ec6c06 to your computer and use it in GitHub Desktop.
TimeSpan between two dates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DateTime startTime = DateTime.Now; | |
//Code here | |
TimeSpan diff = DateTime.Now - startTime; | |
//Use methods in [diff] to get required data. | |
// e.g. the below is to get time in seconds. | |
Console.WriteLine(diff.TotalSeconds); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment