Is there a way to get the time the computer has been on in seconds (or something like that)?

What I'm wanting to do is see how long it takes a program to execute in seconds, so I need a start time and an end time. I know about gettime but that doesn't do what I want.

Thanks for any help