Forums > Dev

scheduler_settime not working?

July 18, 2013 | 6:25 pm

Hi everyone

I’m coding an external for Max 6.1, and have the following code that attempts to set the current time of a scheduler to 0:
x->playbackClock = scheduler_new();
// some time passes
scheduler_settime(x->playbackClock, 0.);
scheduler_gettime (x->playbackClock, &currTime );
post("Tried setting to zero, but got %f",currTime);

If I understand correctly, I should get a value of almost 0 (perhaps a millisecond or two might pass between the settime and gettime).

But instead I get the following output in the Max window:
Tried setting to zero, but got 4289.000000
Tried setting to zero, but got 5291.000000
Tried setting to zero, but got 7446.000000

This is just the elapsed time since the patch opened. Is there are bug, or am I misunderstanding the creation of a local scheduler?

Cheers
Michael


July 20, 2013 | 2:32 pm

I’m glad it’s not just me! I find the documentation completely opaque and confusing. (clocks, setclocks and schedulers? argh!)

I think I’ll just call the system clock and do a subtraction.


Viewing 2 posts - 1 through 2 (of 2 total)