using IL2CPU.API;
using IL2CPU.API.Attribs;
using System;
using System.Diagnostics;
using Cosmos.Core;

namespace Cosmos.Core_Plugs.System.Diagnostics
{
    [Plug(Target = typeof(global::System.Diagnostics.Stopwatch))]
    public class StopwatchImpl
    {
        public static long GetTimestamp()
        {
            if (Stopwatch.IsHighResolution)
                // see https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx for more details
                return (long)(CPU.GetCPUUptime() / (double)CPU.GetCPUCycleSpeed() * 1000000d);
            else
                return DateTime.UtcNow.Ticks;
        }
    }
}

using IL2CPU.API;
using IL2CPU.API.Attribs;
using System;
using System.Diagnostics;
using Cosmos.Core;

namespace Cosmos.Core_Plugs.System.Diagnostics
{
    [Plug(Target = typeof(global::System.Diagnostics.Stopwatch))]
    public class StopwatchImpl
    {
        public static long GetTimestamp()
        {
            if (Stopwatch.IsHighResolution)
                // see https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx for more details
                return (long)(ProcessorInformation.GetCycleCount() / (double)ProcessorInformation.GetCycleRate() * 1000000d);
            else
                return DateTime.UtcNow.Ticks;
        }
    }
}

Revert "Change ProcessorInfo to CPU"
Revert "Change ProcessorInfo to CPU"

This reverts commit 0b6b557a5a2ef96672b8924bc666913cab20e788.
