✅ while loop on cpu
is there a type of while loop that doesn't hammer the cpu with checks? like when i type a character, THATS when it updates, instead of as many times as it possibly can, because it slows down my pc and i dont get these issues with other CLI tools (eg. python repl)
24 Replies
post the problematic while loop
an infinite loop with no waiting will hammer the CPU regardless of what language it's written in. there's likely an issue in your C# code
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
yeah, both of those loops utlimately wait on
Console.Read
oh ok
so false alarm?
why did you think they were?
Console.ReadLine Method (System)
Reads the next line of characters from the standard input stream.
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
music was buffering
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
fucks with the code too much
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
no i used it
this is not prudent debugging
and i left it up
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
good point
:kekw:
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
how
wait lemme test it again rq
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
nvm crisis averted
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
but worse cuz it broke my code