Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting process start time in C/C++ program?

934 views
Skip to first unread message

Alex Vinokur

unread,
Jul 16, 2009, 3:03:15 AM7/16/09
to
Hi,

Linux 2.6.18-92.el5

icpc -v
Version 11.0


Is there any way to get process start time in C/C++ program?


Thanks,


Alex Vinokur


Joe Beanfish

unread,
Jul 16, 2009, 10:04:17 AM7/16/09
to
You could look at the timestamp of the files in /proc/yourpid.
Or just call time() as the first thing in main().

Bin Chen

unread,
Jul 24, 2009, 10:01:31 AM7/24/09
to

There are many APIs available can do that, besides time(), there is
gettimeofday() and others.

--------------------------------------
方庄123社区 http://www.fangzhuang123.com/ 芳古园 芳群园 芳星园 芳城园

0 new messages