Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / System Packages
 

Call dbms_utility get_time twice to time the insert statement

SQL> SQL> create table t ( x int ); Table created. SQL> SQL> declare   2          myStart number default dbms_utility.get_time;   3  begin   4          for i in 1 .. 1000   5          loop   6                  insert into t values ( 1 );   7                  commit;   8          end loop;   9          dbms_output.put_line( dbms_utility.get_time-myStart || ' hsecs' );  10  end;  11  / 23 hsecs PL/SQL procedure successfully completed. SQL> SQL> drop table t; Table dropped.