合并 System.Threading.Tasks.NET35
智能大石头 authored at 2023-03-16 23:32:48
410.00 B
X
namespace System.Threading;

internal struct Watch
{
	private long startTicks;

	public long ElapsedMilliseconds => (TicksNow() - startTicks) / 10000;

	public static Watch StartNew()
	{
		Watch result = default(Watch);
		result.Start();
		return result;
	}

	public void Start()
	{
		startTicks = TicksNow();
	}

	public void Stop()
	{
	}

	private static long TicksNow()
	{
		return DateTime.Now.Ticks;
	}
}