PageRenderTime 41ms CodeModel.GetById 38ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/chrono/detail/inlined/process_cpu_clocks.hpp

http://hadesmem.googlecode.com/
C++ Header | 80 lines | 49 code | 16 blank | 15 comment | 0 complexity | 3a602491bd6b7d2a677593121967e1e1 MD5 | raw file
 1//  boost process_cpu_clocks.cpp  -----------------------------------------------------------//
 2
 3//  Copyright 2009-2010 Vicente J. Botet Escriba
 4
 5//  Distributed under the Boost Software License, Version 1.0.
 6//  See http://www.boost.org/LICENSE_1_0.txt
 7
 8//  See http://www.boost.org/libs/chrono for documentation.
 9
10//--------------------------------------------------------------------------------------//
11#ifndef BOOST_CHRONO_DETAIL_INLINED_PROCESS_CPU_CLOCKS_HPP
12#define BOOST_CHRONO_DETAIL_INLINED_PROCESS_CPU_CLOCKS_HPP
13
14
15#include <boost/chrono/config.hpp>
16#include <boost/version.hpp>
17#include <boost/chrono/process_cpu_clocks.hpp>
18#include <boost/throw_exception.hpp>
19#include <boost/system/system_error.hpp>
20
21//----------------------------------------------------------------------------//
22//                                Windows                                     //
23//----------------------------------------------------------------------------//
24#if defined(BOOST_CHRONO_WINDOWS_API)
25#include <boost/chrono/detail/inlined/win/process_cpu_clocks.hpp>
26
27//----------------------------------------------------------------------------//
28//                                 Mac                                        //
29//----------------------------------------------------------------------------//
30#elif defined(BOOST_CHRONO_MAC_API)
31#include <boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp>
32
33//----------------------------------------------------------------------------//
34//                                POSIX                                     //
35//----------------------------------------------------------------------------//
36#elif defined(BOOST_CHRONO_POSIX_API)
37#include <boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp>
38
39#endif  // POSIX
40#if 0
41namespace boost { namespace chrono {
42
43    process_real_cpu_clock::time_point process_real_cpu_clock::now(
44            system::error_code & ec) 
45    {
46        process_times t;
47        process_clock::now(t, ec);
48        return process_real_cpu_clock::time_point(t.real);
49    }
50
51    process_user_cpu_clock::time_point process_user_cpu_clock::now(
52            system::error_code & ec)
53    {
54        process_times t;
55        process_clock::now(t, ec);
56        return process_user_cpu_clock::time_point(t.user);
57    }
58
59    process_system_cpu_clock::time_point process_system_cpu_clock::now(
60            system::error_code & ec) 
61    {
62        process_times t;
63        process_clock::now(t, ec);
64        return process_system_cpu_clock::time_point(t.system);
65    }
66
67    process_cpu_clock::time_point process_cpu_clock::now( 
68            system::error_code & ec ) 
69    {
70        process_times t;
71        process_clock::now(t,ec);
72        time_point::rep r(t.real.count(), t.user.count(), t.system.count());
73        return time_point(duration(r));
74    }
75
76} // namespace chrono
77} // namespace boost
78#endif
79
80#endif