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 12AtomicInt64 Timer::s_numCreated_; 13 14void Timer::restart(Timestamp now) 15{ 16 if (repeat_) 17 { 18 expiration_ = addTime(now, interval_); 19 } 20 else 21 { 22 expiration_ = Timestamp::invalid(); 23 } 24} 25