Posted By

geekzspot on 10/19/12


Tagged

Oracle PLSQL


Versions (?)

PL/SQL Elapsed time


 / Published in: PL/SQL
 

Calculate and display the elapsed time for PL/SQL code

  1. SET SERVEROUTPUT ON
  2.  
  3. start_time INTEGER;
  4. stop_time INTEGER;
  5. start_time := DBMS_UTILITY.GET_TIME;
  6. DBMS_LOCK.SLEEP(42);
  7. stop_time := DBMS_UTILITY.GET_TIME;
  8. DBMS_OUTPUT.PUT_LINE(TO_CHAR((stop_time - start_time)/100) || ' seconds');
  9. /
  10.  
  11. 42 seconds

Report this snippet  

You need to login to post a comment.