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

Did you find this page helpful?