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

AIX programming: high-resolution timer wanted

173 views
Skip to first unread message

Dmitry Bond.

unread,
Oct 20, 2004, 9:52:10 AM10/20/04
to
Hi All.

Could you please help me?
I'm beginner in AIX (currently we are porting some software to AIX from
Tandem and WinNT).
We are using C/C++.
I need high resolution timer on AIX platform (resolution 1 microsecond or
better).
Is it exists?

What it is on other platforms:
* Tandem: functions JULIANTIMESTAMP(), MYPROCESSTIME();
* the same emulated on WinNT via WinAPI functions:
QueryPerformanceFrequency(), QueryPerformanceCounter().

Btw, what you can recommend to read about programming for AIX ?
I mean - something about AIX-specific functions, etc.


WBR,
Dmitry.

ps. please dusplicate answer to dima...@ukr.net


Michael Kraemer

unread,
Oct 20, 2004, 11:26:57 AM10/20/04
to
you could try

struct timeval stv;
struct timezone stz;

gettimeofday( &stv, &stz );

// stv.tv_sec seconds
// stv.tv_usec microseconds

inspecting my source codes their could be another one:

struct timestruc_t stv;

gettimer( TIMEOFDAY, &stv );

// stv.tv_nsec seems to hold nanoseconds

Dale Talcott

unread,
Oct 20, 2004, 1:29:42 PM10/20/04
to
"Dmitry Bond." <dima...@ukr.net> writes:

>Could you please help me?
>I'm beginner in AIX (currently we are porting some software to AIX from
>Tandem and WinNT).
>We are using C/C++.
>I need high resolution timer on AIX platform (resolution 1 microsecond or
>better).
>Is it exists?

Go to

http://publib16.boulder.ibm.com/cgi-bin/ds_rslt?lang=en_US

and search for "timer". Perhaps gettimerid & friends are what you want.

--
Dale Talcott, IT Research Computing Services, Purdue University
a...@quest.cc.purdue.edu http://quest.cc.purdue.edu/~aeh/

Eric.Jones

unread,
Oct 20, 2004, 5:00:16 PM10/20/04
to
Dmitry Bond. wrote:
> Hi All.

>
> I need high resolution timer on AIX platform (resolution 1 microsecond or better).

Have you looked at read_real_time() ??
-part of the Standard C Library (libc.a)
-uses processor real time clock
-nanosecond resolution

read the AIX man page for details, or view here:
http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf2/read_real_time.htm

good tutorial overview on performance tools, (including timing) on AIX machines at LLNL:
http://www.llnl.gov/computing/tutorials/workshops/workshop/performance_tools/MAIN.html

and Nat Mills article "When microseconds matter" at developerWorks has some nice implementation
details (for Win32 APIs) here..
http://www-106.ibm.com/developerworks/library/i-seconds/

..using the alphaWorks High Resolution Time Stamp Facility:
http://www.alphaworks.ibm.com/tech/ibmts

Dmitry Bond.

unread,
Oct 22, 2004, 3:57:24 AM10/22/04
to
Thank you very much. :-)
It was exactly what I needed.

ps. Thanks to all guzs answered me too...


"Eric.Jones" <Eric....@hispeed.ch> wrote in message
news:cl6jam$b4r$1...@newshispeed.ch...

0 new messages