summaryrefslogtreecommitdiff
path: root/chromium/net/quic/quic_clock.h
blob: e6135a930d007d0080521fcaf2132baa0eb51bd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_QUIC_QUIC_CLOCK_H_
#define NET_QUIC_QUIC_CLOCK_H_

#include "base/basictypes.h"
#include "net/base/net_export.h"
#include "net/quic/quic_time.h"

namespace net {

typedef double WallTime;

// Clock to efficiently retrieve an approximately accurate time from an
// EpollServer.
class NET_EXPORT_PRIVATE QuicClock {
 public:
  QuicClock();
  virtual ~QuicClock();

  // Returns the approximate current time as a QuicTime object.
  virtual QuicTime ApproximateNow() const;

  // Returns the current time as a QuicTime object.
  // Note: this use significant resources please use only if needed.
  virtual QuicTime Now() const;

  // WallNow returns the current wall-time - a time that is consistent across
  // different clocks.
  virtual QuicWallTime WallNow() const;
};

}  // namespace net

#endif  // NET_QUIC_QUIC_CLOCK_H_