ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

Multiply

Multiplies a TimeSpan by a number (int)

Source

public static class TimeSpanEx {
    public static TimeSpan Multiply(this TimeSpan timeSpan, int multiplier) {
        return TimeSpan.FromTicks(timeSpan.Ticks * multiplier);
    }
}

Example

var ts = timeSpan.Multiply(5);

Author: Loek van den Ouweland

Submitted on: 26 feb. 2014

Language: C#

Type: TimeSpan

Views: 5476