time · function ·

ComputeTaskRun

Compute task run.

computecpufunctiontimetimingyeho

Measure monotonic time, represent durations, and budget frame work.

external ComputeTaskRun(computeTask handle) -> durationMs

Status: source-declared

Parameters

computeTask handle
Supply handle as computeTask.

Measure completed compute

Wait for CPU compute, then inspect its reported duration.

cpu · compute · timing · executed

using time

[cpu]
compute ApplyDamage(buffer of int health, int damage)
{
    int index = compute.index
    if index >= health.count { return }
    health[index] = health[index] - damage
}

buffer of int health
health.Add(100)
health.Add(80)
health.Add(60)
computeTask job = dispatch ApplyDamage(health, 10)
wait job
if job.failed { Console.Error(job.error.message) Process.Exit(1) }
for index from 0 < health.count { Console.Log(Text.From(health[index])) }
durationMs elapsed = ComputeTaskRun(job)
Console.Log(elapsed.AsText())
project.mech
manifestVersion = "2"
package = "api.example.time__computetaskrun"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "time"
version = "0.1.0"
path = "../../../yeho/packages/time"
Notes and source

Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

yeho/packages/time/time.yh:101