process_metrics_posix.cc revision 90dce4d38c5ff5333bea97d859d4e484e27edf0c
1// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/process/process_metrics.h"
6
7#include <sys/time.h>
8
9namespace base {
10
11int64 TimeValToMicroseconds(const struct timeval& tv) {
12  static const int kMicrosecondsPerSecond = 1000000;
13  int64 ret = tv.tv_sec;  // Avoid (int * int) integer overflow.
14  ret *= kMicrosecondsPerSecond;
15  ret += tv.tv_usec;
16  return ret;
17}
18
19ProcessMetrics::~ProcessMetrics() { }
20
21}  // namespace base
22