I am looking for a way to know how much time will my C program use, preferably before I run it, but if this cannot be known before, then after it has ended.
Is there a way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After, yes. On most (all?) UNIX-y systems, you can use this:
Before, no, because the program could depend on external input. The halting problem might also be an obstacle to finding the amount of time a program would take to execute beforehand.