Limit a program's execution time in C (Monte Carlo technique)

Posted by rrs90 on Stack Overflow See other posts from Stack Overflow or by rrs90
Published on 2011-01-16T13:51:33Z Indexed on 2011/01/16 13:53 UTC
Read the original article Hit count: 495

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about execution-time

Related posts about montecarlo