CSharp examples for System:DateTime
Calculates the elapsed time by subtracting the start time from the time of the call.
using System;/* ww w. j a v a 2 s .com*/ public class Main{ /// <summary> /// Calculates the elapsed time by subtracting the start time from the time of the call. /// </summary> /// <param name="startTime">The time to substract.</param> /// <returns>The elapsed time.</returns> public static int CalculateElapsedTime(int startTime) { return DateTime.Now.Millisecond - startTime; } }