Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: timer function with PL/SQL?

Re: timer function with PL/SQL?

From: <ryama_at_my-dejanews.com>
Date: Fri, 10 Jul 1998 14:39:46 GMT
Message-ID: <6o593j$8d1$1@nnrp1.dejanews.com>


In article <35A5DFAA.34514E70_at_N_O_S_P_A_Msodexho-pass.be>,   Bram Stieperaere <bse_at_N_O_S_P_A_Msodexho-pass.be> wrote:
> Hi All,
>
> how can I measure the execution time of a PL/SQL function with the
> highest possible precision? sysdate works only with seconds. Can I
> access the OS time?
>
> Thanks.
>
>

Hi,

U can use oracle's built-in package to capture the execution time of a PL/SQL function/procedure.

    DBMS_UTILITY.GET_TIME this will capture time to the 100th of a second. (precision value)

e.g.,

  Declare

         time_begin   binary_integer;
         time_end      binary_integer;

  Begin
        time_begin := DBMS_UTILITY.GET_TIME;
          Get_Emp_Details;      -- is the pl/sql function
        time_end  := DBMS_UTILITY.GET_TIME;

     DBMS_OUTPUT.PUT_LINE((time_end - time_begin)/100);
  End;

Yes, u need to divide the difference time by 100. that will give time in 100th of a second. e.g., .08 seconds  Note: Get_Time does not give the system time, but some vague number in

            seconds, 100th of seconds.
            Hence, it is essential to capture time before calling the function
            and after calling the function.

thanx.
-Raj

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Jul 10 1998 - 09:39:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US