Unix timeout command to run a task and kill it after given duration

I need to run a command and execute task. It need to kill it if is is still running after a specified duration on Unix system. How do I use timeout command on Unix?

The syntax is

timeout DURATION COMMAND

Say run ping command for 10 seconds:

timeount 10s ping 192.168.2.254

See the following for more info
https://www.cyberciti.biz/faq/linux-run-a-command-with-a-time-limit/