ElapsedSeconds
Gest the elapsed seconds since the input DateTime
Source
/// <summary>
/// Gest the elapsed seconds since the input DateTime
/// </summary>
/// <param name="input">Input DateTime</param>
/// <returns>Returns a Double value with the elapsed seconds since the input DateTime</returns>
/// <example>
/// Double elapsed = dtStart.ElapsedSeconds();
/// </example>
/// <seealso cref="Elapsed()"/>
public static Double ElapsedSeconds(this DateTime input)
{
return DateTime.Now.Subtract(input).TotalSeconds;
}
Example
DateTime dtStart = DateTime.Now;
// Do something
Double elapsed = dtStart.ElapsedSeconds();