Skip to content

Get Sansar

Script API

Microthread

Where: Client
More page actions

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Class Namespace Sansar.Microthreading Inherits IDisposable

Internal class used to manage scheduling of tasks

public class Microthread : IDisposable

Members at a glance

KindMembers
ConstructorsMicrothread
FieldsThreadState
MethodsDispose · GetCurrentThreadTicks · ToString · Yield · YieldCurrentThread · YieldIfQuantaExceeded

Constructors

Microthread

public Microthread()

No description in the API snapshot.

Fields

ThreadState

protected Microthread.State ThreadState

The current state of this thread.

Methods

Dispose

public virtual void Dispose()

Disposes resources used by this microthread.

GetCurrentThreadTicks

public static long GetCurrentThreadTicks()

Returns the time when this thread will yield.

Returns: long — The timestamp as returned by Stopwatch.GetTimestamp when this thread will yield.

ToString

public override string ToString()

No description in the API snapshot.

Yield

public void Yield()

Explicitly yield the current thread or coroutine.

YieldCurrentThread

public static long YieldCurrentThread()

Explicitly yield the current thread or coroutine.

Returns: long — Returns the current thread ticks as returned by Microthread.GetCurrentThreadTicks.

YieldIfQuantaExceeded

public static void YieldIfQuantaExceeded()

Conditionally yields if the thread has exceeded its given runtime.

public static long YieldIfQuantaExceeded(long ticks)

Conditionally yields if the thread has exceeded its given runtime.

ParameterTypeDescription
tickslong

Returns: long

Generated from the Sansar 47.10.0 client ScriptApi snapshot.