A script-enabled browser is required for this page to function properly.

ORA_PROF.ELAPSED_TIME built-in function

This function returns the amount of time accumulated in the code timer since the last call to ORA_PROF.RESET_TIMER.

Syntax


FUNCTION ORA_PROF.ELAPSED_TIME
  (timer PLS_INTEGER)
RETURN PLS_INTEGER;

Parameters

Parameter

Description

timer

The name of the timer.

 

Returns

The amount of time (in milliseconds) accumulated in the code timer.

Example


 /*
  ** Create a timer, start it, run a subprogram,
  ** stop the timer, then display the time in
  ** seconds. Destroy the timer when finished.
 */


PROCEDURE timed_proc (test VARCHAR2) IS
i PLS_INTEGER;
BEGIN
  ORA_PROF.CREATE_TIMER ('loop2');
  Ora_PROF.START_TIMER ('loop2');
  test;
  ORA_PROF.STOP_TIMER ('loop2');
  TEXT_IO.PUT ('Loop executed in %s seconds.\n',
  ORA_PROF.ELAPSED_TIME('loop2'));
  ORA_PROF.DESTROY_TIMER('loop2');
END;

See also

About the ORA_PROF built-in package

ORA_PROF built-in package