Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- class ConsoleTests
- {
- static void Main()
- {
- var ticks = Stopwatch.GetTimestamp();
- var uptime = ((double)ticks) / Stopwatch.Frequency;
- var uptimeSpan = TimeSpan.FromSeconds(uptime);
- string output = null;
- output = "Last boot: " + uptimeSpan.ToString("%d") + " days, " + uptimeSpan.ToString("%h") +
- " hours, " + uptimeSpan.ToString("%m") + " minutes ago.";
- Console.WriteLine(output);
- Console.WriteLine();
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment