✅ 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
mg
mg3mo ago
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
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
mg
mg3mo ago
yeah, both of those loops utlimately wait on Console.Read
it’s raining outside
oh ok so false alarm?
mg
mg3mo ago
why did you think they were?
mg
mg3mo ago
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
music was buffering
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
fucks with the code too much
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
no i used it
mg
mg3mo ago
this is not prudent debugging
it’s raining outside
and i left it up
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
good point :kekw:
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
mg
mg3mo ago
how
it’s raining outside
wait lemme test it again rq
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
nvm crisis averted
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
it’s raining outside
but worse cuz it broke my code
Want results from more Discord servers?
Add your server