ElapsedSeconds

/// <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();

Description

Gest the elapsed seconds since the input DateTime

Details

Double click on the code to select all.

 

;