Skip to content

Commit

Permalink
no smart ticking
Browse files Browse the repository at this point in the history
  • Loading branch information
syifan committed Nov 22, 2024
1 parent 010fddd commit c00d4b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions monitoring/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ func (m *Monitor) RegisterPerfAnalyzer(pa *analysis.PerfAnalyzer) {
func (m *Monitor) RegisterComponent(c sim.Component) {
m.components = append(m.components, c)

tickingComp, ok := c.(*sim.TickingComponent)
if ok {
tickingComp.TickNow(0)
}

m.registerBuffers(c)
}

Expand Down
9 changes: 5 additions & 4 deletions sim/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ func (c *TickingComponent) NotifyRecv(
// Handle triggers the tick function of the TickingComponent
func (c *TickingComponent) Handle(e Event) error {
now := e.Time()
madeProgress := c.ticker.Tick(now)
if madeProgress {
c.TickLater(now)
}
// madeProgress :=
c.ticker.Tick(now)
// if madeProgress {
c.TickLater(now)
// }
return nil
}

Expand Down

0 comments on commit c00d4b8

Please sign in to comment.