|
|
Get current time
How can we get current time accurate to milli sec in C++/unix?
Is there some API to perform this function?
|
|
0
|
|
|
|
Reply
|
rishi.shah (13)
|
9/27/2005 10:25:22 PM |
|
Rich Teer <rich.teer@rite-group.com> writes:
> On Tue, 27 Sep 2005, rishi.shah@patni.com wrote:
>
>> How can we get current time accurate to milli sec in C++/unix?
>> Is there some API to perform this function?
>
> Dujno about milliseconds, but gettimeofday will give it to you
> in microseconds, provided your HW and OS support that granularity.
ftime(3) will give you milliseconds. I can't say I've used it,
though; I always use gettimeofday(2).
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
Debian GNU/Linux http://www.debian.org/
GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
|
|
0
|
|
|
|
Reply
|
Roger
|
9/27/2005 10:26:30 PM
|
|
On Tue, 27 Sep 2005, rishi.shah@patni.com wrote:
> How can we get current time accurate to milli sec in C++/unix?
> Is there some API to perform this function?
Dujno about milliseconds, but gettimeofday will give it to you
in microseconds, provided your HW and OS support that granularity.
HTH,
--
Rich Teer, SCNA, SCSA, OpenSolaris CAB member
President,
Rite Online Inc.
Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich
|
|
0
|
|
|
|
Reply
|
Rich
|
9/27/2005 10:29:38 PM
|
|
rishi.shah@patni.com wrote:
> How can we get current time accurate to milli sec in C++/unix?
> Is there some API to perform this function?
gettimeofday()
clock_gettime()
The second one is interesting because you can specify CLOCK_REALTIME (ie
wallclock) or CLOCK_MONOTONIC (doesn't jump with NTP corrections).
Chris
|
|
0
|
|
|
|
Reply
|
Chris
|
9/27/2005 10:49:53 PM
|
|
|
3 Replies
200 Views
(page loaded in 0.04 seconds)
Similiar Articles: get current drift value - comp.protocols.time.ntpis there a way to get the current drift value, using ntp utilities such as ntpq and ntpdc, instead of opening the ntp.drift file? ... How to get the time difference in a script - comp.unix.solaris ...How to add 7 days to the current date? - comp.lang.javascript ... Subtracting dates to get time in years - comp.soft-sys.matlab ... How to add 7 days to ... System-API to get current process memory usage for C/C++ pgm ...What if any system calls exist to get the current process' system memory usage (including ... Privacy Policy | All Times Are GMT(UTC) | powered by generic time parsing functions, getdate() DATEMSK examples, and ...generic time parsing functions, getdate() DATEMSK examples, and ... Unix & Linux: Get current time - programming.itags.org generic time parsing functions, getdate ... How to get the current working directory - comp.lang.idl-pvwave ...How to get the current working directory - comp.lang.idl-pvwave ... find a folder in the ... Privacy Policy | All Times Are GMT(UTC) | powered by Subtracting dates to get time in years - comp.soft-sys.matlab ...Date and Time Calculation - comp.databases.filemaker How to get current date, time and timezone offset ... ... in number of days, months and years between two dates. How to store current matrix in a variable? - comp.graphics.api ...d) Your CPU is also "hardware" (last time I checked...) and runs at a much higher ... user name? - comp.unix.programmer Get variable by name - comp.lang.asm.x86 get current ... Utility to measure time drift - comp.protocols.time.ntpget current drift value - comp.protocols.time.ntp Utility to measure time drift - comp.protocols.time.ntp get current drift value - comp.protocols.time.ntp is there a way ... Finding difference in minutes between 2 DateTimes - comp.databases ...I'm a MS SQL guy and brand new to Informix. I'm trying to find a status time in minutes and I can't seem to figure it out. Select (current-u.st... Auto update Todays Date record script - comp.databases.filemaker ...I cannot figure out how to get the one record to auto-update to Get(Current d... ... Get(CurrentDate) This field will update itself with "today's" date every time ... The World Time Server: current local time and date in any zoneWorld Time Server shows current local time and date in cities and countries in all time zones, adjusted for Daylight Saving Time rules automatically. The official US time (NIST)The official U.S. time. Public service cooperatively provided by the two time agencies of United States: a civilian agency, the National Institute of Standards and ... 7/22/2012 1:55:14 PM
|
|
|
|
|
|
|
|
|