2009-06-18

erlang에서 비교시간만큼 sleep 하기

1> T1=erlang:now().
{1245,308617,699162}
2> T2=erlang:now().
{1245,308624,48042}
3> Tdiff=timer:now_diff(T2,T1).
6348880
4> Tdiff div 1000.
6348
5> timer:sleep(Tdiff div 1000).
ok