module T::Profile

def reset

def reset
  @typecheck_duration = 0
  @typecheck_samples = 0
  @typecheck_sample_attempts = SAMPLE_RATE
end

def typecheck_count_estimate

def typecheck_count_estimate
  typecheck_samples * SAMPLE_RATE
end

def typecheck_duration_estimate

def typecheck_duration_estimate
  total_typechecks = typecheck_samples * SAMPLE_RATE + (SAMPLE_RATE - typecheck_sample_attempts)
  typechecks_measured = typecheck_samples * SAMPLE_RATE
  typecheck_duration * SAMPLE_RATE * 1.0 * total_typechecks / typechecks_measured
end