runtime.Compute · builtin ·

Compute.LastGpuMicroseconds

Read the last available native GPU duration in microseconds after completing a dispatch. This does not measure the whole frame.

builtincomputegameplaygpuyeho

Built into Yeho; no package import is needed. Native services require an admitted host and the correct resource lifecycle.

Compute.LastGpuMicroseconds() -> int

Status: registered-intrinsic

GPU · [gpu]

Run a real GPU reward pass, then read the last available device duration in microseconds. Timing varies and is not an end-to-end speed claim.

gpu · compute · gameplay · executed

[gpu]
compute DoubleRewards(buffer of int rewards, int multiplier)
{
    int index = compute.index
    if index >= rewards.count { return }
    rewards[index] = rewards[index] * multiplier
}

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

[app]
kind = "headless"
Notes and source

The example checks the call shape. Opening windows, recording audio, changing files, network operations, and process operations have real effects when run. Follow the corresponding package lifecycle before using live resources.

yeho/src/compiler/common/intrinsic_registry.cpp:1423