Timeout Command on Mac OS X?

Is there an alternative for the timeout command on Mac OSx. The basic requirement is I am able to run a command for a specified amount of time.

e.g:

timeout 10 ping google.com

This program runs ping for 10s on Linux. Read more

I haven’t checked it out, but it looks like the coreutils package, provided by Homebrew will install this utility (note they use a prefixing mechanism for them, so the actual command would be gtimeout).

———————
Moderator Note: moved post to the general software discussion board.