Skip to content

Instantly share code, notes, and snippets.

@AhnSeongHyun
Created August 6, 2012 22:03
Show Gist options
  • Save AhnSeongHyun/3278879 to your computer and use it in GitHub Desktop.
Save AhnSeongHyun/3278879 to your computer and use it in GitHub Desktop.
measure time
DateTime startDateTime = new DateTime();
startDateTime = DateTime.Now; //현재 시간 저장
Console.WriteLine("Elasped Time[seconds] = {0}", MeasureRunTime(startDateTime));
static string MeasureRunTime(DateTime startDateTime)
{
DateTime endDateTime = new DateTime();
endDateTime = DateTime.Now;
return endDateTime.Subtract(startDateTime).TotalSeconds.ToString("#.##");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment