Hi,
What would be the pros and cons in using [timer] instead of [realtime]. I know the latter asks the OS for time, while [timer] deals with logical time. If I got it right, logical time is tied to the sample rate (and block size), so it's basically the 'Pd time'. Another question would also be, which one is the most accurate? If this question is applicable.
Cheers, Mario
What would be the pros and cons in using [timer] instead of [realtime].
there's really no pro or con, they fullful entirely different tasks. this might not be so obvious when running Pd in realtime mode, but it becomes very apparent when running in batch mode (where the patch might take 1 minute of Pd time but only 1 second of OS time)
personally, I only use [realtime] for profiling tasks. I *never* use it in my patch logic because it isn't deterministic.
Another question would also be, which one is the most accurate? If this question is applicable.
[realtime] is accurate for OS time and [timer] is accurate for Pd time ;-)
Christof
Gesendet: Donnerstag, 31. Januar 2019 um 16:13 Uhr Von: "Mario Buoninfante" mario.buoninfante@gmail.com An: pd-list pd-list@lists.iem.at Betreff: [PD] Advantages of using [timer] over [realtime]
Hi, What would be the pros and cons in using [timer] instead of [realtime]. I know the latter asks the OS for time, while [timer] deals with logical time. If I got it right, logical time is tied to the sample rate (and block size), so it's basically the 'Pd time'. Another question would also be, which one is the most accurate? If this question is applicable. Cheers, Mario_______________________________________________ Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Thu, 2019-01-31 at 15:13 +0000, Mario Buoninfante wrote:
What would be the pros and cons in using [timer] instead of [realtime].
Do you expect some salesman's answer? I'm not good in that. Asking for pros and cons sounds like they have similar features where one is "shining" in one area, while the other is more "brilliant" in this regard. I'd say they are different by nature.
I know the latter asks the OS for time, while [timer] deals with logical time. If I got it right, logical time is tied to the sample rate
No.
(and block size)
No.
, so it's basically the 'Pd time'.
Yes.
I think you figured out the most significant differences already. [timer] is always consistent with objects that are able to schedule something for later, like [metro], [delay], [pipe], [delread~], etc.
However, from what I understand it is not tied to sample rate or blocksize, since it measures logical time in milliseconds. Its accuracy is only limited by the 32bit floating point number format. [timer] will give you the same results, regardless of sample rate.
Another question would also be, which one is the most accurate?
Only [timer] is accurate regarding logical time. Assuming, Pd is running without drop-outs, [realtime] and [timer] will give you similar numbers, but only [timer] reflects the accurate times as they have been generated by [delay], [metro] and such. [realtime] will suffer jitter in the range of your delay in your audio settings. Depending on CPU load, [realtime] will lag behind.
However, if you overload your CPU, because your patch is too demanding to be running in realtime, [realtime] will reflect the effective (phyiscal) time that has passed since it was last triggered. Under such circumstance, the measurements taken by [timer] and [realtime] will drift apart more and more and [realtime] will give you larger values than [timer], because [timer] will be consistent with the amount of audio computed and thus will lag behind realtime.
If this question is applicable.
Try this:
[O]
|
[t b b b]
\ | /
\ [pd heavy_task]
\ /
/
/
/
/
[timer ]
|
[0. \
[timer] will give you always 0. [realtime] will show you the exact amount of time it took to calculate [pd heavy_task]
Heavy task could be something like:
[100000( | [until | [2.34354( | [pow 3842.39]
Hope this helps.
Roman