{"id":"time--TaskRun","name":"TaskRun","owner":"yeho","package":"time","kind":"function","signature":"external TaskRun(task of int handle) -> durationMs","description":"Task run.","context":"Measure monotonic time, represent durations, and budget frame work.","parameters":[{"name":"handle","type":"task of int","description":"Supply handle as task of int."}],"returns":"durationMs","members":[],"tags":["cpu","function","task","time","timing","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"packages/time/time.yh","line":91,"sha256":"a6e5c9d5a17a6556626f010b17b517052180172788d9cfe0ccdbafc6e5b4688c"},"status":"source-declared","notes":["Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup."],"examples":[{"id":"complete","title":"Measure a completed task","description":"Measure a finished score calculation. Durations vary between runs.","code":"using time\n\nScore() -> int { return 40 + 2 }\ntask of int job = task Score()\nwait job\ndurationMs elapsed = TaskRun(job)\nConsole.Log(elapsed.AsText())\n","tags":["cpu","task","timing"],"run":"cpu-oracle","expected":null,"verifyRun":true,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.time__taskrun\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"time\"\nversion = \"0.1.0\"\npath = \"../../../yeho/packages/time\"\n","verification":"executed","sha256":"daaeecb714020f4ead1154f4139c7d8df7ade218527e2c3caec424be76f999d3","checked":"2026-09-09","diagnostic":"","observedOutput":"duration","checkedBackend":"cpu-oracle"}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=time--TaskRun","json":"https://demonhunterlabs.com/reference/items/time--TaskRun.json","markdown":"https://demonhunterlabs.com/reference/text/time--TaskRun.md"}
