*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> complib/second (3)              
Title
Content
Arch
Section
 

Contents


SECOND(3F)							    SECOND(3F)



     SECOND - return the user time for a process in seconds

SYNOPSIS    [Toc]    [Back]

     REAL FUNCTION SECOND( )

PURPOSE    [Toc]    [Back]

     SECOND returns the	user time for a	process	in seconds.  This version gets
     the time from the system function ETIME.

FILES    [Toc]    [Back]

     This particular version of	SECOND is part of the LAPACK distribution
     contained in the COMPLIB.SGIMATH library.











































									Page 1



SECOND(3F)					      Last changed: 2-24-98

NAME    [Toc]    [Back]

     SECOND - Returns elapsed CPU time

SYNOPSIS    [Toc]    [Back]

     All systems:

     second=SECOND()

     UNICOS systems:

     CALL SECOND(second)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk and IRIX	systems

DESCRIPTION    [Toc]    [Back]

     SECOND returns the	elapsed	user CPU time as a real	number in seconds
     (a	default	REAL*4)	since the start	of a program, including	time
     accumulated by all	processes in a multitasking program.

     SECOND returns execution time only	for the	current	program.  For
     example, a	script runs a 50-second	program	10 times.  A SECOND call at
     the end of	the 10th run (or 1st or	3rd or 7th) returns 50 seconds.

     On	UNICOS systems,	SECOND is not appropriate for timing small timed
     regions.  If the timed region is fewer than 4000 clock periods (CPs)
     in	duration, the variation	in the accuracy	of SECOND can be 10% or
     more on one processor.  On	multiple processors, the variation can be
     on	the order of 10,000 to 400,000 CPs.

     The second	argument is the	result,	or CPU time (in	type real seconds)
     accumulated by all	processes in a program.

NOTES    [Toc]    [Back]

     On	UNICOS systems,	the initial call to SECOND may take longer than
     subsequent	calls due to certain initializations performed by the
     routine.  If the cost of calling SECOND is	important, ignore the
     initial call when computing SECOND's time.	 The calculation of
     OVERHEAD in the second example, following,	serves this purpose.  On
     UNICOS systems, the CPU times gathered by SECOND include
     wait-semaphore time.

WARNINGS    [Toc]    [Back]

     If	you are	trying to time your entire program, and	you are	using
     Autotasking, the CPU time returned	by SECOND may not reflect all of
     the CPU time used by your program.	 This is due to	the fact that slave
     CPUs may be still active when your	program	terminates (for	instance,
     with a STOP or END	statement).  Depending on the number of	active CPUs
     on	your machine, the extra	time needed to terminate the slaves may	be
     substantial compared with your program time.  Thus, if you	use SECOND
     to	time your program, and you are also using time(1) or ja(1), the
     time reported by these other utilities could be much higher than that
     reported by SECOND.

     Because of	the large variation on multiple	processors, SECOND should
     be	used cautiously	in multitasked routines.  On IRIX systems, the
     presence of multitasking does not affect the accuracy of SECOND.

EXAMPLES    [Toc]    [Back]

     Example 1:	 This example calculates the CPU time used in DOWORK:

	  BEFORE = SECOND( )
	  CALL DOWORK( )
	  AFTER	= SECOND( )
	  CPUTIME = AFTER - BEFORE

     Example 2:	 If the	CPU time is small enough that the overhead for
     calling SECOND may	be significant,	the following example is more
     accurate:

	  T0 = SECOND( )
	  OVERHEAD = SECOND( ) - T0
	  BEFORE = SECOND( )
	  CALL DOWORK( )
	  AFTER	= SECOND( )
	  CPUTIME = (AFTER - BEFORE) - OVERHEAD

SEE ALSO    [Toc]    [Back]

      
      
     RTC(3I), SECONDR(3F), TIMEF(3F), TSECND(3F)

     ja(1), time(1) in the UNICOS User Commands	Reference Manual,
     publication SR-2011

     Application Programmer's Library Reference	Manual,	publication
     SR-2165, for the printed version of this man page.
SECOND(3F)					      Last changed: 2-24-98

NAME    [Toc]    [Back]

     SECOND - Returns elapsed CPU time

SYNOPSIS    [Toc]    [Back]

     All systems:

     second=SECOND()

     UNICOS systems:

     CALL SECOND(second)

IMPLEMENTATION    [Toc]    [Back]

     UNICOS, UNICOS/mk and IRIX	systems

DESCRIPTION    [Toc]    [Back]

     SECOND returns the	elapsed	user CPU time as a real	number in seconds
     (a	default	REAL*4)	since the start	of a program, including	time
     accumulated by all	processes in a multitasking program.

     SECOND returns execution time only	for the	current	program.  For
     example, a	script runs a 50-second	program	10 times.  A SECOND call at
     the end of	the 10th run (or 1st or	3rd or 7th) returns 50 seconds.

     On	UNICOS systems,	SECOND is not appropriate for timing small timed
     regions.  If the timed region is fewer than 4000 clock periods (CPs)
     in	duration, the variation	in the accuracy	of SECOND can be 10% or
     more on one processor.  On	multiple processors, the variation can be
     on	the order of 10,000 to 400,000 CPs.

     The second	argument is the	result,	or CPU time (in	type real seconds)
     accumulated by all	processes in a program.

NOTES    [Toc]    [Back]

     On	UNICOS systems,	the initial call to SECOND may take longer than
     subsequent	calls due to certain initializations performed by the
     routine.  If the cost of calling SECOND is	important, ignore the
     initial call when computing SECOND's time.	 The calculation of
     OVERHEAD in the second example, following,	serves this purpose.  On
     UNICOS systems, the CPU times gathered by SECOND include
     wait-semaphore time.

WARNINGS    [Toc]    [Back]

     If	you are	trying to time your entire program, and	you are	using
     Autotasking, the CPU time returned	by SECOND may not reflect all of
     the CPU time used by your program.	 This is due to	the fact that slave
     CPUs may be still active when your	program	terminates (for	instance,
     with a STOP or END	statement).  Depending on the number of	active CPUs
     on	your machine, the extra	time needed to terminate the slaves may	be
     substantial compared with your program time.  Thus, if you	use SECOND
     to	time your program, and you are also using time(1) or ja(1), the
     time reported by these other utilities could be much higher than that
     reported by SECOND.

     Because of	the large variation on multiple	processors, SECOND should
     be	used cautiously	in multitasked routines.  On IRIX systems, the
     presence of multitasking does not affect the accuracy of SECOND.

EXAMPLES    [Toc]    [Back]

     Example 1:	 This example calculates the CPU time used in DOWORK:

	  BEFORE = SECOND( )
	  CALL DOWORK( )
	  AFTER	= SECOND( )
	  CPUTIME = AFTER - BEFORE

     Example 2:	 If the	CPU time is small enough that the overhead for
     calling SECOND may	be significant,	the following example is more
     accurate:

	  T0 = SECOND( )
	  OVERHEAD = SECOND( ) - T0
	  BEFORE = SECOND( )
	  CALL DOWORK( )
	  AFTER	= SECOND( )
	  CPUTIME = (AFTER - BEFORE) - OVERHEAD

SEE ALSO    [Toc]    [Back]

      
      
     RTC(3I), SECONDR(3F), TIMEF(3F), TSECND(3F)

     ja(1), time(1) in the UNICOS User Commands	Reference Manual,
     publication SR-2011

     Application Programmer's Library Reference	Manual,	publication
     SR-2165, for the printed version of this man page.
[ Back ]
 Similar pages
Name OS Title
gss_close Tru64 Application Security SDK supports this function only for compatibility. This function is not require...
gss_open Tru64 Application Security SDK supports this function only for compatibility. This function is not require...
erf IRIX error function and complementary error function
erf Linux error function and complementary error function
erf IRIX error function and complementary error function
sinhf NetBSD sine function
cosf NetBSD cosine function
asinf NetBSD arc sine function
acosf NetBSD arc cosine function
tan NetBSD tangent function
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service