llama_perf_reset: Reset performance counters

View source: R/llama.R

llama_perf_resetR Documentation

Reset performance counters

Description

Resets the timing and token count statistics for the context.

Usage

llama_perf_reset(ctx)

Arguments

ctx

Context handle returned by [llama_new_context]

Value

No return value, called for side effects.

Examples

## Not run: 
# Reset counters before benchmarking a specific generation
llama_perf_reset(ctx)
result <- llama_generate(ctx, "Benchmark prompt", max_new_tokens = 100L)
perf <- llama_perf(ctx)
cat("Generation:", perf$n_eval / (perf$t_eval_ms / 1000), "tok/s\n")

## End(Not run)

llamaR documentation built on May 28, 2026, 1:06 a.m.