Use the property Environment.TickCount, in order to get the count of passed milliseconds. Use the fact that one second has 1,000 milliseconds; one minute has 60 seconds; one hour has 60 minutes and one day has 24 hours.
Loading
Use the property Environment.TickCount, in order to get the count of passed milliseconds. Use the fact that one second has 1,000 milliseconds; one minute has 60 seconds; one hour has 60 minutes and one day has 24 hours.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Uday DodiyaPosted Oct 23, 2023, 6:42 AM
Try This
This code will calculate and display the number of milliseconds, seconds, minutes, hours, and days using the Environment.TickCount property in C#.
Sarthak VarshneyPosted Oct 21, 2023, 2:09 PM
You can create a simple C# program to print the count of days using the Environment.TickCount property to measure the number of milliseconds that have passed and then convert it to days. Here's a sample C# program to achieve this:
This program first retrieves the number of milliseconds using
Environment.TickCount, then it converts that into seconds, minutes, hours, and finally, days based on the given conversion factors. It then prints the count of days to the standard output.