blob: da34c180e8ae4e51f5f0b9ffe53b5f7569307b61 [file] [log] [blame]
// Copyright 2013 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.
#include "base/process/process_info.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/process/internal_linux.h"
#include "base/process/process_handle.h"
#include "base/time/time.h"
namespace base {
const Time CurrentProcessInfo::CreationTime() {
ProcessHandle pid = GetCurrentProcessHandle();
int start_ticks = internal::ReadProcStatsAndGetFieldAsInt(
pid, internal::VM_STARTTIME);
TimeDelta start_offset = internal::ClockTicksToTimeDelta(start_ticks);
Time boot_time = internal::GetBootTime();
return Time(boot_time + start_offset);
} // namespace base