ArkaliaCore.Game.Utilities.Basic.GetUptime C# (CSharp) Method

GetUptime() public static method

public static GetUptime ( ) : string
return string
        public static string GetUptime()
        {
            long Uptime = Environment.TickCount - Definitions.StartTime;
            string Time = "";

            if (Uptime >= 24 * 60 * 60 * 1000)
            {
                int Jours = 0;
                while (Uptime > 24 * 60 * 60 * 1000)
                {
                    Jours += 1;
                    Uptime -= 24 * 60 * 60 * 1000;
                }
                Time += Jours + "day" + (Jours > 1 ? "s" : "") + " ";
            }
            if (Uptime >= 60 * 60 * 1000)
            {
                int Hours = 0;
                while (Uptime > 60 * 60 * 1000)
                {
                    Hours += 1;
                    Uptime -= 60 * 60 * 1000;
                }
                Time += Hours + "h ";
            }
            if (Uptime >= 60 * 1000)
            {
                int Minutes = 0;
                while (Uptime > 60 * 1000)
                {
                    Minutes += 1;
                    Uptime -= 60 * 1000;
                }
                Time += Minutes + "m ";
            }
            if (Uptime >= 1000)
            {
                int Seconds = 0;
                while (Uptime > 1000)
                {
                    Seconds += 1;
                    Uptime -= 1000;
                }
                Time += Seconds + "s ";
            }

            int Millisecs = 0;
            while (Uptime > 0)
            {
                Millisecs += 1;
                Uptime -= 1;
            }
            Time += Millisecs + "ms";

            return Time;
        }