Languages
[Edit]
EN

C# / .NET - get current machine time in seconds

10 points
Created by:
aaliyah
471

C# / .NET it is possible to take machine time in seconds in following way.

Getting second time with Stopwatch.GetTimestamp method example

Edit

Example:

Output:

Notes: 
  • Stopwatch.GetTimestamp returns time from timer mechanism - system up time.
  • The best application of this time could be measuring how much time took some operations.

References

Edit
  1. Stopwatch.GetTimestamp Method - Microsoft Docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join