Skip to content

SongLiangChen/timing_wheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

timing_wheel

时间轮算法go语言实现

用例

package main

import (
    "fmt"
    "time"

    "github.com/SongLiangChen/timing_wheel"
)

func timeout(a interface{}) {
    fmt.Println(a)
}

func main() {
    t := timing_wheel.New(time.Second)
    go t.Start()
    defer t.Stop()

    t.NewTimer(time.Second*2, timeout, "hello, timing-wheel")
    time.Sleep(time.Second * 4)
}

About

时间轮算法

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages