Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
sleep_ms.c File Reference

Implements OP_SLEEP_MS to suspend execution for a number of milliseconds. More...

Go to the source code of this file.

Functions

 if (ms.type !=VAL_INT)

Variables

case OP_SLEEP_MS
long t = (long)ms.i

Detailed Description

Implements OP_SLEEP_MS to suspend execution for a number of milliseconds.

Behavior:

  • Pops an integer value ms from the stack and sleeps for that many milliseconds.
  • Always pushes Nil after completion to keep stack discipline for statement POPs.

Errors:

  • If the popped value is not an integer, prints an error, frees it, and pushes Nil.
  • Negative durations are treated as no-op; Nil is still pushed.

Definition in file sleep_ms.c.

Function Documentation

◆ if()

if(ms.type ! = VAL_INT)

Definition at line 25 of file sleep_ms.c.

Here is the call graph for this function:

Variable Documentation

◆ OP_SLEEP_MS

case OP_SLEEP_MS

Definition at line 23 of file sleep_ms.c.

◆ t

long t = (long)ms.i

Definition at line 32 of file sleep_ms.c.