MCPcopy Create free account
hub / github.com/FastLED/FastLED / calculate_phases

Method calculate_phases

ci/meson/build_timer.py:42–75  ·  view source on GitHub ↗

Calculate phase durations from checkpoints.

(self)

Source from the content-addressed store, hash-verified

40 self._checkpoints[name] = time.time()
41
42 def calculate_phases(self) -> None:
43 """Calculate phase durations from checkpoints."""
44 if not self._checkpoints:
45 return
46
47 cp = self._checkpoints
48
49 # Calculate phase times based on checkpoint sequence
50 if "start" in cp:
51 if "meson_setup_done" in cp:
52 self.meson_setup_time = cp["meson_setup_done"] - cp["start"]
53
54 if "ninja_maintenance_done" in cp and "meson_setup_done" in cp:
55 self.ninja_maintenance_time = (
56 cp["ninja_maintenance_done"] - cp["meson_setup_done"]
57 )
58
59 if "compile_done" in cp and "ninja_maintenance_done" in cp:
60 self.compile_time = cp["compile_done"] - cp["ninja_maintenance_done"]
61 elif "compile_done" in cp and "meson_setup_done" in cp:
62 # If ninja maintenance wasn't tracked separately
63 self.compile_time = cp["compile_done"] - cp["meson_setup_done"]
64
65 if "test_execution_done" in cp and "compile_done" in cp:
66 self.test_execution_time = (
67 cp["test_execution_done"] - cp["compile_done"]
68 )
69
70 if "test_execution_done" in cp:
71 self.total_time = cp["test_execution_done"] - cp["start"]
72 elif "compile_done" in cp:
73 self.total_time = cp["compile_done"] - cp["start"]
74 else:
75 self.total_time = time.time() - cp["start"]
76
77 def format_table(self) -> str:
78 """Format timing information as a table."""

Callers 4

format_tableMethod · 0.95
format_simpleMethod · 0.95
_apply_phase_timingFunction · 0.80

Calls 1

timeMethod · 0.80

Tested by

no test coverage detected