Compare if a value is equal to a specified TimeSpan object in CSharp
Description
The following code shows how to compare if a value is equal to a specified TimeSpan object.
Example
using System;//from w w w . java2 s . c o m
class Sample
{
public static void Main()
{
TimeSpan tsX = new TimeSpan(11, 22, 33, 44);
TimeSpan l1 = tsX, l2 = tsX;
Console.WriteLine(l1.Equals(l2));
Console.WriteLine(l1.Equals((Object)l2));
}
}
The code above generates the following result.