CSharp examples for System:TimeSpan
Creates a time span object, representing a given number of milliseconds.
using System.Globalization; using System;/*ww w .j av a 2 s.c om*/ public class Main{ /// <summary> /// <para>Creates a time span object, representing a given number of milliseconds.</para> /// </summary> /// <param name="self">Number of milliseconds.</param> /// <returns>Time span instance.</returns> public static TimeSpan Milliseconds(this int self) { return new TimeSpan(0, 0, 0, 0, self); } /// <summary> /// <para>Creates a time span object, representing a given number of milliseconds.</para> /// </summary> /// <param name="self">Number of milliseconds.</param> /// <returns>Time span instance.</returns> public static TimeSpan Milliseconds(this short self) { return new TimeSpan(0, 0, 0, 0, self); } /// <summary> /// <para>Creates a time span object, representing a given number of milliseconds.</para> /// </summary> /// <param name="self">Number of milliseconds.</param> /// <returns>Time span instance.</returns> public static TimeSpan Milliseconds(this byte self) { return new TimeSpan(0, 0, 0, 0, self); } }