TimeSpan.Milliseconds : TimeSpan « System « C# / C Sharp by API






TimeSpan.Milliseconds

  
using System;

class MainClass
{

  public static void Main()
  {
    DateTime start = DateTime.Now;

    long total = 0;
    for (int count = 0; count < 1000000; count++)
    {
      total += count;
    }

    TimeSpan timeTaken = DateTime.Now - start;

    Console.WriteLine("Milliseconds = " + timeTaken.Milliseconds);
    Console.WriteLine("total = " + total);
  }
}

   
    
  








Related examples in the same category

1.new TimeSpan(days, hours, minutes, seconds)
2.new TimeSpan(days, hours, minutes, seconds, milliseconds
3.new TimeSpan(ticks)
4.TimeSpan + TimeSpan
5.TimeSpan.Add(TimeSpan ts)
6.TimeSpan.Duration()
7.TimeSpan.FromDays
8.TimeSpan.Negate()
9.TimeSpan.Parse
10.TimeSpan.Subtract(TimeSpan ts)
11.TimeSpan.TicksPerDay
12.TimeSpan.TotalDays