+
+ if (RtsFlags.MiscFlags.tickInterval < 0) {
+ RtsFlags.MiscFlags.tickInterval = 50;
+ }
+
+ // If the master timer is disabled, turn off the other timers.
+ if (RtsFlags.MiscFlags.tickInterval == 0) {
+ RtsFlags.ConcFlags.ctxtSwitchTime = 0;
+ RtsFlags.GcFlags.idleGCDelayTime = 0;
+ RtsFlags.ProfFlags.profileInterval = 0;
+ }
+
+ // Determine what tick interval we should use for the RTS timer
+ // by taking the shortest of the various intervals that we need to
+ // monitor.
+ if (RtsFlags.ConcFlags.ctxtSwitchTime > 0) {
+ RtsFlags.MiscFlags.tickInterval =
+ stg_min(RtsFlags.ConcFlags.ctxtSwitchTime,
+ RtsFlags.MiscFlags.tickInterval);
+ }
+
+ if (RtsFlags.GcFlags.idleGCDelayTime > 0) {
+ RtsFlags.MiscFlags.tickInterval =
+ stg_min(RtsFlags.GcFlags.idleGCDelayTime,
+ RtsFlags.MiscFlags.tickInterval);
+ }
+
+ if (RtsFlags.ProfFlags.profileInterval > 0) {
+ RtsFlags.MiscFlags.tickInterval =
+ stg_min(RtsFlags.ProfFlags.profileInterval,
+ RtsFlags.MiscFlags.tickInterval);
+ }
+
+ if (RtsFlags.ConcFlags.ctxtSwitchTime > 0) {
+ RtsFlags.ConcFlags.ctxtSwitchTicks =
+ RtsFlags.ConcFlags.ctxtSwitchTime /
+ RtsFlags.MiscFlags.tickInterval;
+ } else {
+ RtsFlags.ConcFlags.ctxtSwitchTicks = 0;
+ }
+
+ if (RtsFlags.ProfFlags.profileInterval > 0) {
+ RtsFlags.ProfFlags.profileIntervalTicks =
+ RtsFlags.ProfFlags.profileInterval /
+ RtsFlags.MiscFlags.tickInterval;
+ } else {
+ RtsFlags.ProfFlags.profileIntervalTicks = 0;
+ }
+