Does print spamming lag the game? (just a thought)

:thinking: :thinking: What happens if a loop is called to print like 100 sentences continuosly for like an infinite period of time, will it cause the game to crash?

wait(5)
while true do
print("Lets be friends LEts be friends LETs be friends 
LETS be friends LETS Be friends LETS BE friends LETS BE Friends
LETS BE FRiends LETS BE FRIends  LETS BE FRIEnds LETS BE FRIENds
LETS BE FRIENDs LETS BE FRIENDS LETS BE FRIENDS!!!!!")
wait(2^-54) -- woah this number is way too low
end

Anything you do takes power, so of course it will. The amount of power is negligible, even thirty times in a second as you illustrate. The more power you take per second and the less you yield, the more things will lock up. This is more so because other elements of Roblox rely on your code having pauses in it to function. Only one thing ever runs at a time and all tasks such as script threads get routed through a task scheduler, which essentially causes everything to take turns as soon as the script has any sort of pause or yield in it.

But here are a couple of other questions to ask. Why would you do this? If this is a curiosity then fine, but if this is a representation of something else, give us more details and we can give you more specifics. Second, why not try this yourself? It’s pretty straightforward.

1 Like

my pc is a potato, i wont risk it being need to force shutdown :stuck_out_tongue: