In unix, if your output file is called out.txt, you can get the execution time with the command time ./out.txt. Otherwise, you could just use functions from your programming language which measure the time at the start and end, and print out the difference.