Poster of Linux kernelThe best gift for a Linux geek
TAU_PROFILE_DECLARE_

TAU_PROFILE_DECLARE_

Section: TAU Instrumentation API (3) Updated: 08/31/2005
Local index Up
 

NAME

TAU_PROFILE_DECLARE_TIMER - Declares a timer for C  

SYNOPSIS

C:

TAU_PROFILE_DECLARE_TIMER(Profiler timer);
 

DESCRIPTION

Because C89 does not allow mixed code and declarations, TAU_PROFILE_TIMER can only be used once in a function. To declare two timers in a C function, use TAU_PROFILE_DECLARE_TIMER and TAU_PROFILE_CREATE_TIMER.  

EXAMPLE

C :

int f1(void) {
  TAU_PROFILE_DECLARE_TIMER(t1);
  TAU_PROFILE_DECLARE_TIMER(t2);

  TAU_PROFILE_CREATE_TIMER(t1, "timer1", "", TAU_USER);
  TAU_PROFILE_CREATE_TIMER(t2, "timer2", "", TAU_USER);

  TAU_PROFILE_START(t1);
  ...
  TAU_PROFILE_START(t2);
  ...
  TAU_PROFILE_STOP(t2);
  TAU_PROFILE_STOP(t1);
  return 0;
}
    
 

SEE ALSO

TAU_PROFILE_CREATE_TIMER


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 21:56:49 GMT, April 16, 2011