Limit a program's execution time in C (Monte Carlo technique)
- by rrs90
I am working on a project which has no determined algorithm to solve using C language. I am Using Monte Carlo technique for solving that problem. And the number of random guesses I want to limit to the execution time specified by the user.
This means I want to make full use of the execution time limit defined by the user (as a command line argument) to make as many random iterations as possible.
Can I check the execution time elapsed so far for a loop condition.
Eg: for(trials=0;execution_time
P.S. I am using code blocks 10.05 for coding and GNU compiler.