Add performance monitoring feature toggle and integration

- Introduced a new feature flag for performance monitoring in the FeatureFlags class, allowing users to enable or disable monitoring.
- Updated the ScopedTimer class to respect the performance monitoring flag, ensuring that timing operations are no-ops when monitoring is disabled.
- Enhanced the PerformanceMonitor class with methods to set and check the enabled state of performance monitoring, improving flexibility for production builds.
This commit is contained in:
scawful
2025-09-28 22:42:19 -04:00
parent b911256687
commit b82751f9ea
3 changed files with 32 additions and 3 deletions

View File

@@ -38,6 +38,9 @@ class FeatureFlags {
// Log to the console.
bool kLogToConsole = false;
// Enable performance monitoring and timing.
bool kEnablePerformanceMonitoring = true;
// Use NFD (Native File Dialog) instead of bespoke file dialog implementation.
#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD
bool kUseNativeFileDialog = true;
@@ -164,6 +167,7 @@ struct FlagsMenu {
void DrawSystemFlags() {
Checkbox("Enable Console Logging", &FeatureFlags::get().kLogToConsole);
Checkbox("Enable Performance Monitoring", &FeatureFlags::get().kEnablePerformanceMonitoring);
Checkbox("Log Instructions to Emulator Debugger",
&FeatureFlags::get().kLogInstructions);
Checkbox("Use Native File Dialog (NFD)", &FeatureFlags::get().kUseNativeFileDialog);