mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
21
Assets/GameScripts/DotNet/Core/Helper/WinPeriod.cs
Normal file
21
Assets/GameScripts/DotNet/Core/Helper/WinPeriod.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public static class WinPeriod
|
||||
{
|
||||
// 一般默认的精度不止1毫秒(不同操作系统有所不同),需要调用timeBeginPeriod与timeEndPeriod来设置精度
|
||||
[DllImport("winmm")]
|
||||
private static extern void timeBeginPeriod(int t);
|
||||
//[DllImport("winmm")]
|
||||
//static extern void timeEndPeriod(int t);
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
timeBeginPeriod(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user