+
+ // 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.MiscFlags.tickInterval <= 0) {
+ RtsFlags.MiscFlags.tickInterval = 50;
+ }
+
+ 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);
+ }
+
+#ifdef PROFILING
+ if (RtsFlags.ProfFlags.profileInterval > 0) {
+ RtsFlags.MiscFlags.tickInterval =
+ stg_min(RtsFlags.ProfFlags.profileInterval,
+ RtsFlags.MiscFlags.tickInterval);
+ }
+#endif
+
+ if (RtsFlags.ConcFlags.ctxtSwitchTime > 0) {
+ RtsFlags.ConcFlags.ctxtSwitchTicks =
+ RtsFlags.ConcFlags.ctxtSwitchTime /
+ RtsFlags.MiscFlags.tickInterval;
+ } else {
+ RtsFlags.ConcFlags.ctxtSwitchTicks = 0;
+ }
+
+#ifdef PROFILING
+ RtsFlags.ProfFlags.profileIntervalTicks =
+ RtsFlags.ProfFlags.profileInterval / RtsFlags.MiscFlags.tickInterval;
+#endif
+