C# - TimeSpan.TicksPerSecond Property with Example

In this tutorial, we will learn about the C# TimeSpan.TicksPerSecond property with its definition, usage, syntax, and example. By Nidhi Last updated : March 29, 2023

TimeSpan.TicksPerSecond Property

The TimeSpan.TicksPerSecond property is constant which is used to represent the total number of ticks in one second.


long TimeSpan.TicksPerSecond;


  • None

Return Value

This property returns a long integer that represents the total number of ticks in one second.

C# Example of TimeSpan.TicksPerSecond Property

The source code to demonstrate the use of TicksPerSecond property of TimeSpan structure is given below. The given program is compiled and executed successfully.

using System;

class TimeSpanDemo {
  //Entry point of Program
  static public void Main() {
    long tickspersecond;

    tickspersecond = TimeSpan.TicksPerSecond;

    Console.WriteLine("Ticks per second: " + tickspersecond);


Ticks per second: 10000000
Press any key to continue . . .

C# TimeSpan Programs »

Comments and Discussions!

Load comments ↻

Copyright © 2024 www.includehelp.com. All rights reserved.