This commit is contained in:
aozhiwei 2020-11-13 16:08:42 +08:00
parent ce7a0fd64c
commit af4ce33bde

6
app.go
View File

@ -3,6 +3,7 @@ package f5
import (
"flag"
"sync"
"sync/atomic"
"time"
"os"
"q5"
@ -24,6 +25,7 @@ type App_ struct {
chGoLoopTimerExit chan int
chGoLoopWait chan int64
nowTime time.Time
nowUnix int64
imMsgHandlers [1024]func(int16,*q5.XParams)
maxRunDelay int64
maxScheduleTime int64
@ -31,6 +33,7 @@ type App_ struct {
func (this *App_) Init() {
this.nowTime = time.Now()
atomic.StoreInt64(&this.nowUnix, this.nowTime.Unix())
_Timer = &q5.Timer{}
_Timer.Init(
func (context interface{}) int64 {
@ -78,6 +81,7 @@ func (this *App_) UnInit() {
func (this *App_) Run() {
for !this.terminated {
this.nowTime = time.Now()
atomic.StoreInt64(&this.nowUnix, this.nowTime.Unix())
beginTick := q5.GetTickCount()
_Timer.Update()
@ -169,7 +173,7 @@ func (this *App_) schedule() {
}
func (this *App_) NowUnix() int64 {
return this.nowTime.Unix()
return this.nowUnix
}
func (this *App_) outputRuningLog() {