RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • cputime
    • pause
    • set.BusyMode
    • set.ErrorFcn
    • set.ExecutionMode
    • set.Name
    • set.ObjectVisibility
    • set.Period
    • set.StartDelay
    • set.StartFcn
    • set.StopFcn
    • set.Tag
    • set.TasksToExecute
    • set.TimerFcn
    • set.UserData
    • tic
    • timeit
    • timer
    • timerfind
    • timerfindall
    • toc

pause — Suspend execution until user interaction or for a duration.

pause supports keypress wait, nonnegative scalar duration, and session-owned on/off/query state control.

Syntax

out = pause()
out = pause(duration)
state = pause(command)

Inputs

duration
Type
Any
Required
Yes
Description
Nonnegative scalar duration in seconds, or an empty value for keypress wait.
command
Type
StringScalar
Required
Yes
Description
One of 'on', 'off', or 'query'.
NameTypeRequiredDefaultDescription
durationAnyYes—Nonnegative scalar duration in seconds, or an empty value for keypress wait.
commandStringScalarYes—One of 'on', 'off', or 'query'.

Returns

out
Type
NumericArray
Description
Empty array when waiting.
state
Type
StringScalar
Description
Previous or current pause state, 'on' or 'off'.
NameTypeDescription
outNumericArrayEmpty array when waiting.
stateStringScalarPrevious or current pause state, 'on' or 'off'.

Errors

RunMat:pause:InvalidInputArgument
When
Input is malformed, unsupported, nonscalar, or a negative/non-finite duration.
Message
pause: invalid input argument
RunMat:pause:TooManyInputs
When
More than one input argument is supplied.
Message
pause: too many input arguments
RunMat:pause:GpuGatherFailed
When
Gathering a resident input through its owner fails.
Message
pause: failed to gather gpu input
RunMat:pause:ContextUnavailable
When
No invocation timing context is installed.
Message
pause: runtime context is unavailable
IdentifierWhenMessage
RunMat:pause:InvalidInputArgumentInput is malformed, unsupported, nonscalar, or a negative/non-finite duration.pause: invalid input argument
RunMat:pause:TooManyInputsMore than one input argument is supplied.pause: too many input arguments
RunMat:pause:GpuGatherFailedGathering a resident input through its owner fails.pause: failed to gather gpu input
RunMat:pause:ContextUnavailableNo invocation timing context is installed.pause: runtime context is unavailable

Behavior and placement

pause and pause([]) wait for a keypress when enabled; noninteractive standard input may complete immediately. Positive-infinite numeric input follows the default keypress form.

pause(n) waits for a nonnegative real scalar duration in seconds. Zero provides an asynchronous yield point. Waiting is cooperative and cancellation stops the pending timer.

pause('off') and pause('on') change the current session's policy and return the previous state as a character row; pause('query') reads the current state without changing it. Each new runtime context begins enabled.

Every built-in integer scalar class is accepted from authoritative storage before converting at the host timer boundary; logical scalars are also accepted.

Explicit gpuArray input is a RunMat-mode extension gated before provider access. Automatically resident input is gathered through its owner; no pause operation runs on the GPU or joins fusion.

Examples

Pausing for a fixed duration

tic;
pause(0.05);
elapsed = toc

Waiting for user input mid-script

disp('Press any key to continue the demo...');
pause;

Temporarily disabling pauses in automated runs

previous = pause('off');
pause(1.0);
pause(previous);

Querying the current pause mode

current = pause('query');

Using empty input to rely on the default behaviour

pause([]);

Using pause with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how pause changes the result.

Run a small pause example, explain the result, then change one input and compare the output.

FAQ

Does pause block forever when standard input is not interactive?⌄

No. A noninteractive host may complete a keypress request immediately; interactive hosts wait for a key.

What happens if I call pause with a negative duration?⌄

RunMat raises RunMat:pause:InvalidInputArgument.

Does pause accept logical or integer values?⌄

Yes. Logical scalars and all eight integer classes are accepted; integer storage is read exactly before the host timer conversion.

Can I force pausing off globally?⌄

pause('off') disables waits in the current session. Save the returned state and pass it to pause to restore it.

Does pause('query') change the pause state?⌄

No. It returns the current mode, 'on' or 'off'.

Is pause affected by GPU fusion or auto-offload?⌄

It does not enter a GPU timing kernel or fusion; automatically resident input may require owner-aware gather.

What is the default pause state?⌄

'on' for every new RunMat session.

Can I pass a gpuArray as the duration?⌄

RunMat mode accepts explicit gpuArray duration as a gated extension and gathers through the owning provider.

Related Timing functions

cputime · set.BusyMode · set.ErrorFcn · set.ExecutionMode · set.Name · set.ObjectVisibility · set.Period · set.StartDelay · set.StartFcn · set.StopFcn · set.Tag · set.TasksToExecute · set.TimerFcn · set.UserData · tic · timeit · timer · timerfind · timerfindall · toc

Source you can read

Every RunMat function's source is public. Read exactly how pause is executed, line by line, in Rust.

  • View the source for pause in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Behavior and placement
  • Examples
  • Pausing for a fixed duration
  • Waiting for user input mid-script
  • Temporarily disabling pauses in automated runs
  • Querying the current pause mode
  • Using empty input to rely on the default behaviour
  • Using pause with coding agents
  • FAQ
  • Related Timing functions
  • Source you can read
  • About RunMat