[erlang-questions] Sending message at a specific and accurate time

Joe Armstrong erlang@REDACTED
Mon Feb 22 15:55:39 CET 2016


On Mon, Feb 22, 2016 at 3:31 PM, Tony Rogvall <tony@REDACTED> wrote:
>> L = fun Loop() -> receive after 1 ->  Loop()  end end.
>> spawn_link(L).

Busy sleep :-) < I thought busy waiting was frowned upon>

Actually after 10 works as well.

So a work-around is to set the timer 10 ms *before* I want and run a busy sleep
loop -

So I keep having to thumping the damn thing to make it doesn't fall asleep.

I've only tested on an unloaded system - perhaps if the system was loaded
the timings would be better?

Thanks for the tip.

/Joe

>
> That is a process doing minimal sleep, but still sleeps ( I think )
>
> Adding this little ”helper” process changes the timing on my mac to the better.
>
> From 3-4 ms latency to to around 1 or less.
>
> Power cable did not affect the latency for me either.
>
> /Tony
>
>> On 22 feb 2016, at 13:19, Jesper Louis Andersen <jesper.louis.andersen@REDACTED> wrote:
>>
>>
>> On Mon, Feb 22, 2016 at 1:16 PM, Ola Bäckström <Ola.Backstrom@REDACTED> wrote:
>> Do you get different result with power cable plugged in compared to not plugged in?
>>
>> I controlled for that by trying it with and without the cable plugged. It isn't affecting the latencies.
>>
>> Any kind of dynamic timing system shouldn't really affect this either. If anything it ought to improve the precision.
>>
>>
>> --
>> J.
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list