hi guys
i want to ask a question... does anyone know a good way to make timed cycle? because using for (i=0;i<20000000000000000000000000000;i++) works really differently on different pc...
hi guys
i want to ask a question... does anyone know a good way to make timed cycle? because using for (i=0;i<20000000000000000000000000000;i++) works really differently on different pc...
Try and look for sleep functions, these delay the execution of the program instead of looping (and thus using CPU!). Always use sleep and no loops for this.
windows.h has a Sleep() function, google it.
okay, so i have found sleep () function for linux in unistd.h but the problem is that it works with Seconds, not miliseconds... any advices?
microsleep() ? Perhaps working with decimals works...10 ms is the lowest you can get though (depending on your CPU), even if you say it should be 1 ms.
ty 4 help but i've found a better thing
usleep
WTB lib and command to change color -.- not whole screen text but some specific output and etc