Right now I am recording the start/stop times inside my functions using NOW() and storing them in a separate table as TIMESTAMPs. The whole process is messy, but the real problem is that the start and stop times are identical even though some of the queries are quite complex which leads me to believe that no matter how many times you call NOW() from inside a function, it will return the same value. I tried writing to a double Precision value but I am still getting a duration of 0.
How would I go about accurately getting the duration of a Postgres function?