Get uptime in seconds or miliseconds on Unix like systems
06:56 02 Dec 2011

I need a method which can give me the number of miliseconds or seconds, elapsed since the system was started. I could parse /proc/uptime , but I can't afford to lose performance over this I/O and parsing.

I'm using Linux and C/C++. Maybe I can put some Qt/Boost, but is better to be something native.

c++ c linux unix