Skip to content

Commit

Permalink
use the current time consistently for timers
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 9, 2015
1 parent 8aefa99 commit 47b67d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Changes
@@ -1,8 +1,7 @@

5.72 2015-01-09
- Improved Mojo::Reactor::EV performance slightly.
- Improved Mojo::Reactor::EV to update the current time before starting a
timer if EV is not running already.
timer.

5.71 2015-01-01
- Updated Net::DNS::Native requirement to 0.15 for some important bug fixes.
Expand Down
4 changes: 1 addition & 3 deletions lib/Mojo/Reactor/EV.pm
Expand Up @@ -58,10 +58,8 @@ sub _timer {
my ($self, $recurring, $after, $cb) = @_;
$after ||= 0.0001 if $recurring;

# Update current time if EV is not running already
EV::now_update() unless $self->is_running;

my $id = $self->SUPER::_timer(0, 0, $cb);
EV::now_update();
weaken $self;
$self->{timers}{$id}{watcher} = EV::timer(
$after => $after => sub {
Expand Down

0 comments on commit 47b67d8

Please sign in to comment.