*
* @param enabled Turns the performance monitoring system on or off.
*/
public static void setEnabled(boolean enabled) {
if (enabled && !(instance instanceof PerformanceMonitorImpl)) {
instance = new PerformanceMonitorImpl();
} else if (!enabled && !(instance instanceof NullPerformanceMonitor)) {
instance = new NullPerformanceMonitor();
}
}