API ReferenceSandbox.Services

BenchmarkSystemclass

Allows access to stats for the current game. Stats are defined by the game's author and can be used to track anything from player actions to performance metrics. They are how you submit data to leaderboards.

objectBenchmarkSystem
Namespace
Sandbox.Services
Assembly
Sandbox.Engine
Declaration
public class Sandbox.Services.BenchmarkSystem

Constructors1

Showing 1 constructors

Methods5

Showing 5 methods

public void Finish()PUBLIC

Called to close a benchmark off

Returns:void

public void Sample()PUBLIC

Should be called in update every frame

Returns:void

public System.Threading.Tasks.Task`1<System.Guid> SendAsync(System.Threading.CancellationToken token = null)PUBLIC

Finish this benchmark session and send it off to the backend

ParameterTypeDescription
token = nullCancellationToken
Returns:Task<Guid>

public void SetMetric(string name, double metric)PUBLIC

Set a custom metric, like load time, shutdown time etc

ParameterTypeDescription
namestring
metricdouble
Returns:void

public void Start(string name)PUBLIC

Called to start a benchmark

ParameterTypeDescription
namestring
Returns:void

On this page