Software /
code /
prosody
Comparison
net/server.lua @ 1885:1fde15a415e6
net.server: Pass current time to timer callbacks
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 04 Oct 2009 16:04:33 +0100 |
parent | 1884:6eaa440bc9fc |
child | 1886:d19c0a21bfb6 |
comparison
equal
deleted
inserted
replaced
1884:6eaa440bc9fc | 1885:1fde15a415e6 |
---|---|
819 end | 819 end |
820 clean( _closelist ) | 820 clean( _closelist ) |
821 _currenttime = os_time( ) | 821 _currenttime = os_time( ) |
822 if os_difftime( _currenttime - _timer ) >= 1 then | 822 if os_difftime( _currenttime - _timer ) >= 1 then |
823 for i = 1, _timerlistlen do | 823 for i = 1, _timerlistlen do |
824 _timerlist[ i ]( ) -- fire timers | 824 _timerlist[ i ]( _currenttime ) -- fire timers |
825 end | 825 end |
826 _timer = _currenttime | 826 _timer = _currenttime |
827 end | 827 end |
828 socket_sleep( _sleeptime ) -- wait some time | 828 socket_sleep( _sleeptime ) -- wait some time |
829 --collectgarbage( ) | 829 --collectgarbage( ) |