Re: measure time intervals - Mailing list pgsql-general

From Merlin Moncure
Subject Re: measure time intervals
Date
Msg-id CAHyXU0ynLSKNMrUzoX5D2Wh6HVbAuFPY3Xyn8ws8riNBKbKS7A@mail.gmail.com
Whole thread Raw
In response to measure time intervals  (Vincent Dautremont <vincent@searidgetech.com>)
List pgsql-general
On Thu, Apr 5, 2012 at 9:00 AM, Vincent Dautremont
<vincent@searidgetech.com> wrote:
> Hi,
> I'm wondering ig it is possible to measure elapsed time between 2 particular
> queries in PostgreSQL.
>
> what I need is the equivalent of @@TIMETICKS in Transac-SQL
> or CLOCK_MONOTONIC  in Unix
> or GetTickCount in Windows
>
> These are not affected by system time changes, so time interval can be
> calculated even if the system time is changed by NTP or the user.
> That's why I can't use any function based on system time.

one way that will work is to write a C module for postgres that wraps
the system call.  that's a heavy dependency for such a small thing
though.  also FYI GetTickCount wraps around approximately every three
and a half weeks.

merlin

pgsql-general by date:

Previous
From: Vincent Dautremont
Date:
Subject: Re: measure time intervals
Next
From: Raymond O'Donnell
Date:
Subject: Re: measure time intervals