Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » How fast are forever loops
- duckboycool
-
1000+ posts
How fast are forever loops
I want to know if I did:
when green flag clickedHow large this will be in one second
forever
change [This v] by [1]
end
- AonymousGuy
-
1000+ posts
How fast are forever loops
According to an experiment I did, the variable will be equal to about 900,000 after one second.
However, this isn't exactly accurate, as any block that causes a delay will slow it down significantly.
Putting the variable in a conditional:
Putting in a wait block like this:
Really, forever loops are basically arbitrary.
However, this isn't exactly accurate, as any block that causes a delay will slow it down significantly.
Putting the variable in a conditional:
when gf clickedreduces the variable down to 500,000.
forever
if <not <>> //Always true
change [var v] by (1)
end
end
Putting in a wait block like this:
when gf clickedwill make the var only go up to 30.
forever
change [var v] by (1)
wait (0) secs
end
Really, forever loops are basically arbitrary.
- duckboycool
-
1000+ posts
How fast are forever loops
This is because 0.0= a very small number (in the scratch system) According to an experiment I did, the variable will be equal to about 900,000 after one second.
However, this isn't exactly accurate, as any block that causes a delay will slow it down significantly.
Putting the variable in a conditional:when gf clickedreduces the variable down to 500,000.
forever
if <not <>> //Always true
change [var v] by (1)
end
end
Putting in a wait block like this:when gf clickedwill make the var only go up to 30.
forever
change [var v] by (1)
wait (0) secs
end
Really, forever loops are basically arbitrary.
- duckboycool
-
1000+ posts
How fast are forever loops
For me 455327 when I did forever plain.
452802 When I broadcasted the stop
317542 With a if <Not> in it
33 with wait 0 secs inside.
452802 When I broadcasted the stop
317542 With a if <Not> in it
33 with wait 0 secs inside.
- drmcw
-
1000+ posts
How fast are forever loops
If that is the only script then it will go as fast as your computer can. If you have any other scripts running that change the screen then the loop will convert to it's screen refresh rate which is 30 per second.
- stickfiregames
-
1000+ posts
How fast are forever loops
No, it's because any wait block (even if it is 0) forces Scratch to draw a new frame, and Scratch runs at 30 fps. The 0.0 > 0 thing was fixed, and anyway the example AonymousGuy gave was with 0 secs, not 0.0.This is because 0.0= a very small number (in the scratch system) According to an experiment I did, the variable will be equal to about 900,000 after one second.
However, this isn't exactly accurate, as any block that causes a delay will slow it down significantly.
Putting the variable in a conditional:when gf clickedreduces the variable down to 500,000.
forever
if <not <>> //Always true
change [var v] by (1)
end
end
Putting in a wait block like this:when gf clickedwill make the var only go up to 30.
forever
change [var v] by (1)
wait (0) secs
end
Really, forever loops are basically arbitrary.
Also, it depends on your computer speed. I tried the first example on my (very slow) computer, and only got about 30000/second.
Last edited by stickfiregames (April 28, 2015 22:02:53)
- CatsUnited
-
1000+ posts
How fast are forever loops
What do you mean? But why do seconds stay a second long?
- duckboycool
-
1000+ posts
How fast are forever loops
if it's program speed then why does a second stay a second long while shorter time periods don'tWhat do you mean? But why do seconds stay a second long?
- CatsUnited
-
1000+ posts
How fast are forever loops
Because of the FPS. If I didif it's program speed then why does a second stay a second long while shorter time periods don'tWhat do you mean? But why do seconds stay a second long?
wait (0.01) secs, it would run for about 0.03 seconds.
- MathlyCat
-
1000+ posts
How fast are forever loops
Depends what's inside the loop, and comp speed, normal speed would be 60FPS
- Discussion Forums
- » Questions about Scratch
-
» How fast are forever loops