Esempio n. 1
0
        //---------------------------------------------------------------------
        public EbTimer(TimerShaft timer_shaft, ulong tm, LuaTable lua_table, DelegateLua2 cb)
        {
            TimerShaft      = timer_shaft;
            TmSpan          = tm;
            LuaTable        = lua_table;
            FuncCb          = cb;
            LastTimeJeffies = TimerShaft.GetTimeJeffies() + TmSpan;
            Closed          = false;
            Stopwatch       = new Stopwatch();
            Stopwatch.Start();

            var time_ev = new EbTimeEvent()
            {
                mExpires = TimerShaft.GetTimeJeffies() + TmSpan,
                onTime   = _onTimer,
                mData    = null
            };

            TimerShaft.AddTimer(time_ev);
        }
Esempio n. 2
0
        //---------------------------------------------------------------------
        public EbTimer RegisterTimer(ulong tm, LuaTable lua_table, DelegateLua2 cb)
        {
            EbTimer timer = new EbTimer(this, tm, lua_table, cb);

            return(timer);
        }