Skip to content

refactor: use time.perf_counter() for duration measurements#848

Open
m92y wants to merge 1 commit intoml-explore:mainfrom
m92y:refactor/perf-counter-timing
Open

refactor: use time.perf_counter() for duration measurements#848
m92y wants to merge 1 commit intoml-explore:mainfrom
m92y:refactor/perf-counter-timing

Conversation

@m92y
Copy link

@m92y m92y commented Feb 6, 2026

Refactor to use time.perf_counter() instead of time.time() for duration measurements.

Files modified:

  • mlx_lm/cache_prompt.py
  • mlx_lm/perplexity.py
  • mlx_lm/quant/dwa.py
  • mlx_lm/server.py

Rationale:

Note: time.time() is intentionally preserved in server.py line 244 (self.created = int(time.time())) as this generates an epoch timestamp for API responses, not a duration measurement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant