Monday, February 23, 2015

CALCULATION OF TIME ELAPSED USING UTILITY GET TIME

-- Usage Notes
--You should not use GET_TIME to establish the current time, but only to calculate the elapsed time between two events. Without GET_TIME, Oracle functions can only record and provide elapsed time in second intervals, which is a very coarse granularity in today's world of computing. With GET_TIME, you can get a much finer understanding of the processing times of lines in your program.
--Example
--The following example calculates the number of 100ths of elapsed seconds since the calc_totals procedure was executed:

DECLARE
   time_before BINARY_INTEGER;
   time_after BINARY_INTEGER;
BEGIN
   time_before := DBMS_UTILITY.GET_TIME;
   calc_totals;
   time_after := DBMS_UTILITY.GET_TIME;
   DBMS_OUTPUT.PUT_LINE (time_after - time_before);
END;

No comments:

Post a Comment