<div dir="ltr">On 5 November 2014 13:50, Tony Rogvall <span dir="ltr"><<a href="mailto:tony@rogvall.se" target="_blank">tony@rogvall.se</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi!<br>
<br>
>From time to time I implement protocols and services that need watch dogs and/or retransmit timers.<br>
I will normally implement this using a BIF timer:<br></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
</div><snip><br>
</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I propose a new BIF:<br>
<br>
erlang:restart_timer(Ref, Time) -> false | RemainingTime<br>
<br>
This will restart a time if it is active and return the time that remained when it was restarted.<br>
If restart_timer return false either the timer has already time out or the reference is not a timer.<br>
<br></blockquote><div><br></div><div>I second this proposal, quite a useful feature to have when implementing protocols. Fewer lines of code and the code becomes more readable.<br><br></div><div>Chandru<br> <br></div></div></div></div>