author | Josh Pelkey <jpelkey@gatech.edu> |
Fri, 13 May 2011 14:52:27 -0400 | |
changeset 7169 | 358f71a624d8 |
parent 6821 | 203367ae7433 |
child 7386 | 2310ed220a61 |
permissions | -rw-r--r-- |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2005 INRIA |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage.inria.fr> |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
*/ |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
|
34
f2aa05303e7c
remove more unused files, rename system files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
33
diff
changeset
|
21 |
#include "system-wall-clock-ms.h" |
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
22 |
#include "abort.h" |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
23 |
#include <sys/times.h> |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
|
16
99e833adbb46
change yans namespace to ns3
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
9
diff
changeset
|
25 |
namespace ns3 { |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
34
f2aa05303e7c
remove more unused files, rename system files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
33
diff
changeset
|
27 |
class SystemWallClockMsPrivate { |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
public: |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
29 |
void Start (void); |
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
30 |
int64_t End (void); |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
31 |
int64_t GetElapsedReal (void) const; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
32 |
int64_t GetElapsedUser (void) const; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
33 |
int64_t GetElapsedSystem (void) const; |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
34 |
|
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
35 |
private: |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
36 |
struct tms m_startTimes; |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
37 |
clock_t m_startTime; |
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
38 |
int64_t m_elapsedReal; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
39 |
int64_t m_elapsedUser; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
40 |
int64_t m_elapsedSystem; |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
}; |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
110
diff
changeset
|
44 |
SystemWallClockMsPrivate::Start (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
{ |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
46 |
m_startTime = times (&m_startTimes); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
47 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
49 |
int64_t |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
110
diff
changeset
|
50 |
SystemWallClockMsPrivate::End (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
{ |
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
52 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
53 |
// We need to return the number of milliseconds that have elapsed in some |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
54 |
// reasonably portable way. The underlying function that we will use returns |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
55 |
// a number of elapsed ticks. We can look up the number of ticks per second |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
56 |
// from the system configuration. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
57 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
58 |
// Conceptually, we need to find the number of elapsed clock ticks and then |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
59 |
// multiply the result by the milliseconds per clock tick (or divide by clock |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
60 |
// ticks per millisecond). Integer dividing by clock ticks per millisecond |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
61 |
// is bad since this number is fractional on most machines and would result |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
62 |
// in divide by zero errors due to integer rounding. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
63 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
64 |
// Multiplying by milliseconds per clock tick works up to a clock resolution |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
65 |
// of 1000 ticks per second. If we go past this point, we begin to get zero |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
66 |
// elapsed times when millisecondsPerTick becomes fractional and another |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
67 |
// rounding error appears. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
68 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
69 |
// So rounding errors using integers can bite you from both direction. Since |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
70 |
// all of our targets have math coprocessors, why not just use doubles |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
71 |
// internally? Works fine, lasts a long time. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
72 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
73 |
// If millisecondsPerTick becomes fractional, and an elapsed time greater than |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
74 |
// a milliscond is measured, the function will work as expected. If an elapsed |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
75 |
// time is measured that turns out to be less than a millisecond, we'll just |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
76 |
// return zero which would, I think, also will be expected. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
77 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
78 |
static int64_t ticksPerSecond = sysconf (_SC_CLK_TCK); |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
79 |
static double millisecondsPerTick = 1000. / ticksPerSecond; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
80 |
|
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
81 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
82 |
// If sysconf () fails, we have no idea how to do the required conversion to ms. |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
83 |
// |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
84 |
NS_ABORT_MSG_IF (ticksPerSecond == -1, "SystemWallClockMsPrivate(): Cannot sysconf (_SC_CLK_TCK)"); |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
85 |
|
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
86 |
struct tms endTimes; |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
87 |
clock_t endTime = times (&endTimes); |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
88 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
89 |
double tmp; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
90 |
|
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
91 |
tmp = static_cast<double> (endTime - m_startTime) * millisecondsPerTick; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
92 |
m_elapsedReal = static_cast<int64_t> (tmp); |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
93 |
|
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
94 |
tmp = static_cast<double> (endTimes.tms_utime - m_startTimes.tms_utime) * millisecondsPerTick; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
95 |
m_elapsedUser = static_cast<int64_t> (tmp); |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
96 |
|
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
97 |
tmp = static_cast<double> (endTimes.tms_stime - m_startTimes.tms_stime) * millisecondsPerTick; |
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
98 |
m_elapsedSystem = static_cast<int64_t> (tmp); |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
99 |
|
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
100 |
return m_elapsedReal; |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
101 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
102 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
103 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
104 |
SystemWallClockMsPrivate::GetElapsedReal (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
105 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
106 |
return m_elapsedReal; |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
107 |
} |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
108 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
109 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
110 |
SystemWallClockMsPrivate::GetElapsedUser (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
111 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
112 |
return m_elapsedUser; |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
113 |
} |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
114 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
115 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
116 |
SystemWallClockMsPrivate::GetElapsedSystem (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
117 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
118 |
return m_elapsedSystem; |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
119 |
} |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
120 |
|
34
f2aa05303e7c
remove more unused files, rename system files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
33
diff
changeset
|
121 |
SystemWallClockMs::SystemWallClockMs () |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
122 |
: m_priv (new SystemWallClockMsPrivate ()) |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
123 |
{ |
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
124 |
} |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
125 |
|
34
f2aa05303e7c
remove more unused files, rename system files
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
33
diff
changeset
|
126 |
SystemWallClockMs::~SystemWallClockMs () |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
127 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
128 |
delete m_priv; |
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
129 |
m_priv = 0; |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
130 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
131 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
132 |
void |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
110
diff
changeset
|
133 |
SystemWallClockMs::Start (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
134 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
135 |
m_priv->Start (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
136 |
} |
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
137 |
|
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
138 |
int64_t |
122
6b8f1eda5c57
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
110
diff
changeset
|
139 |
SystemWallClockMs::End (void) |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
140 |
{ |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
131
diff
changeset
|
141 |
return m_priv->End (); |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
142 |
} |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
143 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
144 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
145 |
SystemWallClockMs::GetElapsedReal (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
146 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
147 |
return m_priv->GetElapsedReal (); |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
148 |
} |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
149 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
150 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
151 |
SystemWallClockMs::GetElapsedUser (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
152 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
153 |
return m_priv->GetElapsedUser (); |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
154 |
} |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
155 |
|
5458
15fcd24f8b1e
make win32 compile again
Craig Dowell <craigdo@ee.washington.edu>
parents:
5457
diff
changeset
|
156 |
int64_t |
5457
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
157 |
SystemWallClockMs::GetElapsedSystem (void) const |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
158 |
{ |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
159 |
return m_priv->GetElapsedSystem (); |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
160 |
} |
8cb18165e22f
Apply Gustavo's patch for MinGW compatibiliy
Craig Dowell <craigdo@ee.washington.edu>
parents:
5441
diff
changeset
|
161 |
|
16
99e833adbb46
change yans namespace to ns3
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
9
diff
changeset
|
162 |
}; // namespace ns3 |