Skip to content

Commit 8da5336

Browse files
committed
adjust heuristics for 1khz vs 100hz tick
also allow slowing clock down because it looks like irix 5.3 underestimates the speed when calibrating
1 parent b50b892 commit 8da5336

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/mips_core.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,15 @@ impl MipsCore {
499499
const TARGET_10MS: u64 = 10_000_000;
500500
if dc > 0 {
501501
let target_ns = delta.saturating_mul(dt_ns) / dc * 2;
502-
// If estimated target is under 5ms, treat as 1kHz tick, else 100Hz.
503-
let snapped_ns = if (target_ns >> 16) < 5_000_000 {
502+
// If estimated target is under 3ms, treat as 1kHz tick, else 100Hz.
503+
let snapped_ns = if (target_ns >> 16) < 3_000_000 {
504504
TARGET_1MS
505505
} else {
506506
TARGET_10MS
507507
};
508508
let denom = dc.saturating_mul(snapped_ns);
509509
self.count_step = (delta.saturating_mul(dt_ns) / denom)
510-
.clamp(1 << 14, 10 << 15);
510+
.clamp(1 << 12, 10 << 15);
511511
#[cfg(feature = "developer_ip7")]
512512
{
513513
let total_samples: u32 = self.compare_delta_stats.values().sum();

0 commit comments

Comments
 (0)