MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / NewClock

Function NewClock

plugin/manager/timer/timer.go:40–47  ·  view source on GitHub ↗

NewClock 添加一个新时钟

(db *sql.Sqlite)

Source from the content-addressed store, hash-verified

38
39// NewClock 添加一个新时钟
40func NewClock(db *sql.Sqlite) (c Clock) {
41 c.cron = cron.New()
42 c.entries = make(map[uint32]cron.EntryID)
43 c.timers = &map[uint32]*Timer{}
44 c.loadTimers(db)
45 c.cron.Start()
46 return
47}
48
49// RegisterTimer 注册计时器
50func (c *Clock) RegisterTimer(ts *Timer, save, isinit bool) bool {

Callers 2

initFunction · 0.92
TestClockFunction · 0.85

Calls 1

loadTimersMethod · 0.80

Tested by 1

TestClockFunction · 0.68