1// excerpts from http://code.google.com/p/muduo/
2//
3// Use of this source code is governed by a BSD-style license
4// that can be found in the License file.
5//
6// Author: Shuo Chen (chenshuo at chenshuo dot com)
7
8#include "Timer.h"
9
10using namespace muduo;
11
12void Timer::restart(Timestamp now)
13{
14  if (repeat_)
15  {
16    expiration_ = addTime(now, interval_);
17  }
18  else
19  {
20    expiration_ = Timestamp::invalid();
21  }
22}
23