{"id":"time--ComputeTaskTotal","name":"ComputeTaskTotal","owner":"yeho","package":"time","kind":"function","signature":"external ComputeTaskTotal(computeTask handle) -> durationMs","description":"Compute task total.","context":"Measure monotonic time, represent durations, and budget frame work.","parameters":[{"name":"handle","type":"computeTask","description":"Supply handle as computeTask."}],"returns":"durationMs","members":[],"tags":["compute","cpu","function","time","timing","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"packages/time/time.yh","line":96,"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 completed compute","description":"Wait for CPU compute, then inspect its reported duration.","code":"using time\n\n[cpu]\ncompute ApplyDamage(buffer of int health, int damage)\n{\n    int index = compute.index\n    if index >= health.count { return }\n    health[index] = health[index] - damage\n}\n\nbuffer of int health\nhealth.Add(100)\nhealth.Add(80)\nhealth.Add(60)\ncomputeTask job = dispatch ApplyDamage(health, 10)\nwait job\nif job.failed { Console.Error(job.error.message) Process.Exit(1) }\nfor index from 0 < health.count { Console.Log(Text.From(health[index])) }\ndurationMs elapsed = ComputeTaskTotal(job)\nConsole.Log(elapsed.AsText())\n","tags":["cpu","compute","timing"],"run":"cpu-oracle","expected":null,"verifyRun":true,"manifest":"manifestVersion = \"2\"\npackage = \"api.example.time__computetasktotal\"\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":"33d8462ce66c228feacc607c0aae94ba05f1a3ea3f19168e37a27d8c09b1f3c0","checked":"2026-09-09","diagnostic":"","observedOutput":"90\n70\n50\nduration","checkedBackend":"cpu-oracle"}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=time--ComputeTaskTotal","json":"https://demonhunterlabs.com/reference/items/time--ComputeTaskTotal.json","markdown":"https://demonhunterlabs.com/reference/text/time--ComputeTaskTotal.md"}
