Time limit in command line

Hi everybody,
I want to run a command like ./test but i want to set time limit for executing that!
for example i want this command to be executed just for 5 secounds(not anymore), what i have to use in command line?
is there -t option for that?
imagine i want to execute a cpp binary file!

Try some of the suggestions here:

[SOLVED] How can I execute a program with a specified max. time (BASH) [Archive] - Ubuntu Forums](http://ubuntuforums.org/archive/index.php/t-596109.html)