C# TicksPer constants

CsharpProgrammingServer Side Programming

TicksPer constants in C# have TicksPerDay, TicksPerHour, TicksPerMinute, TicksPerSecond, and TicksPerMillisecond constants. A millisecond consists of 10,000 ticks.

Here are the TicksPer constants −

TimeSpan.TicksPerDay
TimeSpan.TicksPerHour
TimeSpan.TicksPerMinute

Example

 Live Demo

using System;
using System.Linq;
public class Demo {
   public static void Main() {
      // TicksPer constant
      Console.WriteLine(TimeSpan.TicksPerDay);
      Console.WriteLine(TimeSpan.TicksPerHour);
      Console.WriteLine(TimeSpan.TicksPerMinute);
   }
}

Output

864000000000
36000000000
600000000
raja
Published on 04-Sep-2018 13:49:53
Advertisements