Skip to content

Repository files navigation

HashedWheelTimer

Nuget

High performance and light weight HashedWheelTimer implement by c#

fork from DotNetty

Install nuget package

dotnet add package WheelTimer

Usages

// 1. Inheritance interface: `ITimerTask`// such as:publicclassActionTimerTask:ITimerTask{readonlyAction<ITimeout>action;publicActionTimerTask(Action<ITimeout>action)=>this.action=action;publicvoidRun(ITimeouttimeout)=>this.action(timeout);}// 2. add ITimerTask by `NewTimeout` methodITimertimer=newHashedWheelTimer(TimeSpan.FromMilliseconds(100),512,-1);ITimeouttimeout=timer.NewTimeout(newActionTimerTask(
t =>{// do what you want here}),TimeSpan.FromSeconds(10));timer.StopAsync().Wait();
``

About

High performance and light weight HashedWheelTimer implement by c#

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages