|
|
back to boardCommon Boardlook inside i want to exit from my brute force program after 3 (for example)seconds from its start.Give me please an example of code in С/C++ that will help me. Re: look inside Posted by Vesper 21 Apr 2004 19:12 Grab the timer interrupt and set global flag in your calculations. After 3 seconds drop the flag by your interrupt handler and quit the main program. And do not forget to restore interrupt vector. Not very universal, but oftenly help. Calculate amount of iterations in your brute force cycle. If IT - (amount of iterations) exceed maximum value which is set by hands and individually, you just stop bruteforcing. You can set MaxIT = 1 million. If it gets WA in 0.4 second, then you can increase MaxIT twice. Hope this clear. |
|
|