Here is my basic code...
Within thw while loop there is some simple code that shouldn't take much processor time. But on the WinXP task manager, it shows it using 99% of CPU. Any way to make it faster? I don't need it to update so often, only like once every second.. would a Sleep(1000); at the end of the while loop speed it up? thanks!Code:#include <iostream> #include <windows.h> #include <fstream> #include <string> using namespace std; extern "C" WINBASEAPI HWND WINAPI GetConsoleWindow(); // this needs to be declared because microsoft forgot it :P int main() { /* Hide window */ HWND hWnd; AllocConsole(); hWnd = GetConsoleWindow(); ShowWindow(hWnd, SW_HIDE); /***************/ while(1) { //Some stuff here } return 0; }



LinkBack URL
About LinkBacks


