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

Did you find this page helpful?