Thread: CURRENT_TIME

CURRENT_TIME

From
"FERREIRA William (COFRAMI)"
Date:
hi
 
i need to know the execution time of a part of my pl/pgsql code
 
so, i tried to use CURRENT_TIME :
 
t_time_d TIME;
t_time_f TIME;
t_diff TIME;
 
select CURRENT_TIME into t_time_d;
 
    //the traitment
 
 
select CURRENT_TIME into t_time_f;
t_diff=t_time_f-t_time_d;
raise notice 'DEBUT : % | FIN : % | DIFF : % | POUR : %',t_time_d,t_time_f,t_diff;
 
my function is recursive and the problem is that i always get the same result for each iteration
t_time_d is set at the first iteration and doesn't change
 
thanks
 

Re: CURRENT_TIME

From
Michael Glaesemann
Date:
On Mar 15, 2005, at 23:21, FERREIRA William (COFRAMI) wrote:

> i need to know the execution time of a part of my pl/pgsql code
>  
> so, i tried to use CURRENT_TIME :

<snip />

> my function is recursive and the problem is that i always get the same
> result for each iteration
> t_time_d is set at the first iteration and doesn't change

You're probably looking for timeofday(). See the docs at

http://www.postgresql.org/docs/8.0/interactive/functions-
datetime.html#FUNCTIONS-DATETIME-CURRENT

Hope this helps.

Michael Glaesemann
grzm myrealbox com