标签:dbms_utility.get_tim dbms_utility.get_cpu
DBMS_UTILITY.GET_TIME与DBMS_UTILITY.GET_CPU_TIME比较
例1:一个计算密集(cpu-bound)型例子
DECLARE b1 PLS_INTEGER; b2 PLS_INTEGER; e1 PLS_INTEGER; e2 PLS_INTEGER; n PLS_INTEGER := 0; BEGIN b1 := DBMS_UTILITY.GET_TIME(); b2 := DBMS_UTILITY.GET_CPU_TIME(); FOR i IN 1 .. 100000000 LOOP --NULL; n := n + 1; END LOOP; e1 := DBMS_UTILITY.GET_TIME() - b1; e2 := DBMS_UTILITY.GET_CPU_TIME() - b2; DBMS_OUTPUT.PUT_LINE( 'GET_TIME elapsed = ' || e1 || ' hsecs.' ); DBMS_OUTPUT.PUT_LINE( 'GET_CPU_TIME elapsed = ' || e2 || ' hsecs.' ); END;
DECLARE b1 PLS_INTEGER; b2 PLS_INTEGER; e1 PLS_INTEGER; e2 PLS_INTEGER; BEGIN b1 := DBMS_UTILITY.GET_TIME(); b2 := DBMS_UTILITY.GET_CPU_TIME(); FOR r IN ( SELECT * FROM all_source ) LOOP NULL; END LOOP; e1 := DBMS_UTILITY.GET_TIME() - b1; e2 := DBMS_UTILITY.GET_CPU_TIME() - b2; DBMS_OUTPUT.PUT_LINE( 'GET_TIME elapsed = ' || e1 || ' hsecs.' ); DBMS_OUTPUT.PUT_LINE( 'GET_CPU_TIME elapsed = ' || e2 || ' hsecs.' ); END; /
PL/SQL 过程已成功完成。
-------------------------------------------
Dylan Presents.
Oracle DBMS_UTILITY.GET_TIME与DBMS_UTILITY.GET_CPU_TIME区别
标签:dbms_utility.get_tim dbms_utility.get_cpu
原文地址:http://blog.csdn.net/indexman/article/details/43341253