User forums > General (but related to Code::Blocks)

How to get program run time?

(1/1)

rEgonicS:
Sorry for the bad wording in the title because I wasn't sure as towards how to phrase it.
I was wondering if there's an option/setting/plugin that will return the length of time the program has been running for. I know that the IDE outputs the length of time the program has been running but it only tells me how long the program has been running until I actually close the window. Preferably, this feature would return the length of time the program has been running until it terminates and is accurate to the millisecond.

Note* I make console applications.

Thanks

stahta01:
Research your operating system and you might find the right command.

I do not know of an part of Code::Blocks that does this; you might look at the profiling plug-in it would be my best guess of which plug-in might support your request.

Tim S.

a14331990:
Windows Server 2003 Resource Kit Tools contains a useful tool called "timeit"
http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
For Linux, the built-in command "time" maybe enough, for example
$ time ./a.out
Hello!

real   0m0.003s
user   0m0.001s
sys   0m0.002s

You can also integrate  these two handy tools in the Tools menu, like this
Name: Timeit
Executable: timeit
Parameters: ${TARGET_OUTPUT_FILE}
Working Directory: ${PROJECT_DIR}
Hope this help.

oBFusCATed:
rEgonicS: if you're on linux you can see the code of the time command
and then you can modify the console_runner application (part of C::B, you can find it in svn)
to show the information you need.

Navigation

[0] Message Index

Go to full version