# What does the warp block do?

What does the
[scratchblocks]
warp{
}::grey
[/scratchblocks]
block do?

The warp block runs faster than normal, as it doesn't take intermediate steps. This is useful for complex/slow projects. Just make sure to right-click on blocks and select help to see what they do.

when the warp block is being ran, it stops all running code until it's finished, so instead of
[scratchblocks]
warp {
forever {
...
} :: control cap
} :: grey
[/scratchblocks]
do

[scratchblocks]
forever {
warp {
...
} :: grey
} :: control cap
[/scratchblocks]

Expanding on what @ego-lay_atman-bay said:
[scratchblocks]
warp {
forever {
... :: grey
} :: control
} :: grey
[/scratchblocks]

warp stops other scripts until its inside script is finished (and makes the stage update the graphics less often); because there is a forever loop, it will never finish, so other scripts cannot run.

[scratchblocks]
forever {
warp {
... :: grey
} :: grey
} :: control
[/scratchblocks]
when the forever loop gets to the warp, the other scripts stop; when the warp finishes, the other scripts can run for a little bit until the forever goes back to the warp.

1 Like

It is a turbo mode simulator thing. If you put a script inside it, the script will run like it's turbo mode.

This is only partly true. Turbo mode gives scripts higher priority, relative to redisplay, but it still updates the display sometimes. WARP does even less display updating, and of course it absolutely freezes all scripts other than this one. So, for example, although people mainly use WARP for processing speed, it can also be used to make a critical section atomic, to avoid concurrency bugs.

1 Like