Answer: Use zlog::time! with .warn_if_gt and a Duration threshold, e.g. let _timer = zlog::time!("my_function_name").warn_if_gt(std::time::Duration::from_millis(100)); Status: Overdue (check was due 2026-11-20T13:44:16Z and has not succeeded) Entry: tool/zed/troubleshooting/warn-slow-function Revision: 1 Digest: sha256:7db752c64f58bd02 (changes whenever the content changes) Timeline: Created: 2026-11-13T04:05:47Z Last changed: 2026-11-13T04:05:47Z Last verified: 2026-11-19T13:44:16Z Next check: 2026-11-20T13:44:16Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Unit | Source | As of threshold | 100 | milliseconds | [1] | 2026-11-19 code example | let _timer = zlog::time!("my_function_name").warn_if_gt(std::time::Duration::from_millis(100)); | | [1] | 2026-11-19 Sources: [1] Zed Industries. "zed.dev/docs/performance.md". https://zed.dev/docs/performance.md Role: primary. Accessed: 2026-11-19T13:44:16Z Quote: "std::time::Duration::from_millis(100)" (Supports: threshold) Quote: "let _timer = zlog::time!("my_function_name").warn_if_gt(std::time::Duration::from_millis(100));" (Supports: code example) Snapshot SHA-256: 4c391b7ef539239f478a48e218ca5a07d0da0cb21795f5518eae96f3c9c4863e (captured 2026-11-13T04:05:45Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T04:05:47Z, so the values verified then were kept. Cross-check: not-available at 2026-11-19T13:44:16Z. No independent second source is configured for this entry Last successful check: 2026-11-19T13:44:16Z Last attempt: 2026-11-19T13:44:16Z Notes and limitations: Extracted automatically from a single official source (section "Warn if function is slow"). Human-readable page: https://zed.dev/docs/performance.html Related: https://latestn.com/tool/zed/troubleshooting/why-toolchains-needed Why does Zed need a toolchain for language servers to work? https://latestn.com/tool/zed/troubleshooting/zed-blank-window-windows What should I do if Zed fails to start or shows a blank window on Windows? https://latestn.com/tool/zed/troubleshooting/zed-measurements How do I enable and use ZED_MEASUREMENTS to measure Zed performance? https://latestn.com/tool/zed/troubleshooting/shell-debugger-usage How do I run Zed under GDB or LLDB from a shell? https://latestn.com/tool/zed/troubleshooting/show-lsp-error-messages How do I show language server error messages in the Zed status bar? https://latestn.com/tool/zed/troubleshooting/verify-ocamllsp-installed How do I verify that ocamllsp is installed for Zed? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T04:05:47Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/zed/troubleshooting/warn-slow-function/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/zed/troubleshooting/warn-slow-function POST: https://latestn.com/dispute/tool/zed/troubleshooting/warn-slow-function with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/zed/troubleshooting/warn-slow-function?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I make Zed warn me when a function is slow? Revision 1, last verified 2026-11-19T13:44:16Z. https://latestn.com/tool/zed/troubleshooting/warn-slow-function (accessed 2026-11-21T09:53:12Z). @misc{LatestN_tool_zed_troubleshooting_warn_slow_function_r1, title = {How do I make Zed warn me when a function is slow?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/zed/troubleshooting/warn-slow-function}}, note = {Revision 1; digest sha256:7db752c64f58bd02; last verified 2026-11-19T13:44:16Z; accessed 2026-11-21T09:53:12Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/zed/troubleshooting/warn-slow-function