File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,11 @@ function Profiler:EmitEvent(event--[[#: TEvent]])
256256 local idx = self .event_count + 1
257257 self .events [idx ] = event
258258 self .event_count = idx
259+
260+ if event .time - self .last_flush_time >= self .flush_interval then
261+ self .last_flush_time = event .time
262+ self :Save ()
263+ end
259264end
260265
261266-- --- Section tracking ---
447452 -- Event accumulation
448453 self .events = {}
449454 self .event_count = 0
450- self .last_flush_time = 0
455+ self .last_flush_time = self . time_start
451456 -- String interning
452457 self .strings = {}
453458 self .string_lookup = {}
525530 vm_state = vmstate ,
526531 section_path = self .section_path ,
527532 }
528- local now = self .get_time ()
529-
530- if now - self .last_flush_time >= self .flush_interval then
531- self .last_flush_time = now
532- self :Save ()
533- end
534533 end )
535534 end
536535
You can’t perform that action at this time.
0 commit comments