C# - Environment.TickCount Property with Example

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

Environment.TickCount Property

The Environment.TickCount property returns an integer value that denotes the number of milliseconds elapsed since the system stated.

Syntax

int Environment.TickCount

Parameter(s)

  • None

Return Value

This property returns an 'int' value.

C# Example of Environment.TickCount Property

The source code to get the number of milliseconds elapsed since system started using Environment class is given below. The given program is compiled and executed successfully.

using System;

class Sample
{
    //Entry point of Program
    static public void Main()
    {
        int tickCount = 0;

        tickCount = Environment.TickCount;
        Console.WriteLine("Tick Count: "+tickCount);
    }
}

Output

Tick Count: 3228690
Press any key to continue . . .

C# Environment Class Programs »






Comments and Discussions!

Load comments ↻






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