[Ace-users] [ace-users] Calcule the microseconds difference between two times
Douglas C. Schmidt
schmidt at dre.vanderbilt.edu
Wed Oct 10 10:27:24 CDT 2007
Thanks for using the PRF.
> CIAO VERSION: 0.5.9
> TAO VERSION : 1.5.9
> ACE VERSION : 5.5.9
> HOST MACHINE and OPERATING SYSTEM:
> If on Windows based OS's, which version of WINSOCK do you
> use?: Pentium IV, Debian linux kernel 2.6
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> COMPILER NAME AND VERSION (AND PATCHLEVEL):
> THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
> specific file, simply state which one]:#include "ace/config-
> THE $ACE_ROOT/include/makeinclude
> /platform_macros.GNU FILE [if you
> use a link to a platform-specific file, simply state which one
> (unless this isn't used in this case, e.g., with Microsoft Visual
> include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/
> (used by MPC when you generate your own makefiles): There is no
> such file.
> AREA/CLASS/EXAMPLE AFFECTED:
> [What example failed? What module failed to compile?]
> DOES THE PROBLEM AFFECT:
> COMPILATION? No.
> If so, what do your $ACE_ROOT/ace/config.h and
> $ACE_ROOT/include/makeinclude/platform_macros.GNU contain?
> LINKING? No.
> On Unix systems, did you run make realclean first?
> EXECUTION? No.
> OTHER (please specify)?
> [Please indicate whether ACE/TAO/CIAO, your application, or both are
> SYNOPSIS: Calcule the microseconds difference between two times.
> [Brief description of the problem]
> [Detailed description of problem. Don't just say "<blah>
> doesn't work, here's a fix," explain what your program does
> to get to the <blah> state. ]
> I need to calculate the microseconds elapsed from one start time to one end time. I'm using the ACE_Date_Time class to
> obtain the current time value. Can I subtract these values to obtain the difference of the two times in microseconds? I
> took a look at the ACE_Time_Value class too but I wasn't able to make it work. I would appreciate if you can help me with
> this matter or point me an example that I can follow.
I think you probably want to use ACE_High_Res_Timer for this stuff since
the other timers have too coarse a level of granularity. Please see
for an example of how to use this.
More information about the Ace-users