TimeUpdater is nothing special, just a program I put together in a few minutes which outputs the time in 24h format 1000 times per second so that the time outputted is very accurate.

This is needed for another project I am working on and I am just sharing it incase it is of any use to anyone reading this.

C#
using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Threading.Tasks; using System.Drawing; using System.Windows.Forms; using System.IO; namespace TimeUpdater { public class Home : Form { private Timer timer; private IContainer components = null; private Button btnStart; private Button btnStop; private Label lblTime; protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); if (e.CloseReason == CloseReason.WindowsShutDown || !timer.Enabled) { return; } switch (MessageBox.Show(this, "Are you sure you want to close?", "Closing", MessageBoxButtons.YesNo)) { case DialogResult.No: e.Cancel = true; break; default: break; } } public Home() { btnStart = new Button(); btnStop = new Button(); lblTime = new Label(); timer = new Timer(); SuspendLayout(); btnStart.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); btnStart.Location = new Point(18, 47); btnStart.Name = "btnStart"; btnStart.Size = new Size(86, 23); btnStart.Text = "Start"; btnStart.Click += new EventHandler(start); btnStop.Anchor = ((AnchorStyles)(((AnchorStyles.Bottom | AnchorStyles.Left) | AnchorStyles.Right))); btnStop.Location = new Point(114, 47); btnStop.Name = "btnStop"; btnStop.Size = new Size(86, 23); btnStop.Text = "Stop"; btnStop.Click += new EventHandler(stop); lblTime.AutoSize = true; lblTime.Location = new Point(94, 17); lblTime.Name = "lblTime"; lblTime.Size = new Size(0, 13); AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(222, 90); Controls.Add(lblTime); Controls.Add(btnStop); Controls.Add(btnStart); FormBorderStyle = FormBorderStyle.FixedSingle; MaximizeBox = false; MaximumSize = new Size(238, 129); MinimumSize = new Size(238, 129); Name = "Home"; Text = "Time Updater"; timer.Interval = 1000; timer.Enabled = false; timer.Tick += new EventHandler(writeFile); ResumeLayout(false); PerformLayout(); } private void start(object sender, EventArgs e) { timer.Enabled = true; timer.Start(); } private void stop(object sender, EventArgs e) { timer.Stop(); timer.Enabled = false; } private void writeFile(object sender, EventArgs e) { string time = string.Format("{0}:{1}", DateTime.Now.Hour.ToString().PadLeft(2, '0'), DateTime.Now.Minute.ToString().PadLeft(2, '0')); lblTime.Text = time; File.WriteAllText("time.txt", time); } } }