Created
May 26, 2023 17:43
-
-
Save puppis42/5d17f83ed47282638968e8959d040161 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace Get_Boot_Time | |
{ | |
public partial class Frm_Main : Form | |
{ | |
public Frm_Main() | |
{ | |
InitializeComponent(); | |
} | |
[DllImport("kernel32")] | |
extern static UInt64 GetTickCount64(); | |
public static TimeSpan GetUpTime() | |
{ | |
return TimeSpan.FromMilliseconds(GetTickCount64()); | |
} | |
private void Frm_Main_Load(object sender, EventArgs e) | |
{ | |
lbl1.Text = "Boot Time : " + GetUpTime(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment