[info-performer] 1 pfGetTime second = 0.999431389441131s

Date view Thread view Subject view Author view

From: Hugues De Keyzer (hugues++at++depinxi.be)
Date: 04/14/2005 01:55:56


Hi all,

while working on an application with long soundtracks (minutes) and lip-sync, we noticed that the use of pfGetTime() as timer caused a increasing delay to appear between the sound and the picture. The sound comes from an external source and is triggered by the Performer application. When replacing it with gettimeofday() it works fine.

After some tests, we realized that the time returned by pfGetTime() is "slower" than the real time. Although it was already the case with Performer 3.1.1 on Linux 2.4, it becomes quite worse with Peformer 3.2 on Linux 2.6, as shown below:

Performer 3.1.1 / Linux 2.4 (RedHat Enterprise WS 3)
delay: ~1.67e-06 s/s
1 s = ~0.99999833 s

Performer 3.2 / Linux 2.4 (Slackware 9.1)
delay: 1.945e-05 s/s
1 s = 0.9999805 s

Performer 3.2 / Linux 2.6 (RedHat Enterprise WS 4)
delay: 5.6861e-04 s/s
1 s = 0.999431 s

Here is a function to replace pfGetTime() for those who want more precise timing:

double currTime()
{
    struct timeval tv;

    gettimeofday(&tv, NULL);
    return static_cast<double>(tv.tv_sec) + static_cast<double>(tv.tv_usec) / 1000000;
}

Regards,

Hugues De Keyzer
de pinxi


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Apr 14 2005 - 02:00:31 PDT