dbms_utility.get_time : dbms_utility « PL SQL Programming « Oracle PL/SQL Tutorial






SQL>
SQL> declare
  2      type rc is ref cursor;
  3      l_rc rc;
  4      l_dummy all_objects.object_name%type;
  5      l_start number default dbms_utility.get_time;
  6  begin
  7      for i in 1 .. 1000
  8      loop
  9          open l_rc for
 10          'select object_name
 11             from all_objects
 12            where object_id = :x'
 13          using i;
 14          fetch l_rc into l_dummy;
 15          close l_rc;
 16      end loop;
 17      dbms_output.put_line
 18      ( round( (dbms_utility.get_time-l_start)/100, 2 ) ||
 19        ' seconds...' );
 20  end;
 21  /
.63 seconds...

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.70
SQL>
SQL> set timing off








24.26.dbms_utility
24.26.1.dbms_utility.get_time
24.26.2.Declare dbms_utility.get_time as a variable default value