Timing Programs

I would like to be able to time and/or test my programs using a similar program to the ones found in online judges. Does anyone know of a good free judge I can use?
You could simply use time and diff
To set a time-limit for a running program, you can set an alarm() and kill() your children
Yup if you use linux on the terminal, you can just type 'time' followed by the location of your .exe file and it should tell you how long it ran.

ex:
$ time ./Sum Numbers.txt
55373762303908766373020487468329478597177365459831892672

real	0m0.005s
user	0m0.008s
sys	0m0.000s


real time is what you want to know
Last edited on
you can set an alarm() and kill() your children

Heh
<ctime> has a function which tells how many milliseconds have elapsed since the program started.
http://www.cplusplus.com/reference/ctime/
Topic archived. No new replies allowed.