Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
17bd284d
Commit
17bd284d
authored
12 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
support MinGW and Cygwin on Windows
parent
f5c1a5d3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
BaseLib/MemWatch.cpp
+2
-2
2 additions, 2 deletions
BaseLib/MemWatch.cpp
BaseLib/MemWatch.h
+1
-1
1 addition, 1 deletion
BaseLib/MemWatch.h
BaseLib/RunTime.cpp
+3
-3
3 additions, 3 deletions
BaseLib/RunTime.cpp
BaseLib/RunTime.h
+2
-2
2 additions, 2 deletions
BaseLib/RunTime.h
with
8 additions
and
8 deletions
BaseLib/MemWatch.cpp
+
2
−
2
View file @
17bd284d
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#include
"MemWatch.h"
#include
"MemWatch.h"
#ifndef
WIN32
#ifndef
_MSC_VER
namespace
BaseLib
{
namespace
BaseLib
{
...
@@ -71,4 +71,4 @@ unsigned long MemWatch::getCodeMemUsage () {
...
@@ -71,4 +71,4 @@ unsigned long MemWatch::getCodeMemUsage () {
}
// end namespace BaseLib
}
// end namespace BaseLib
#endif //
WIN
#endif //
_MSC_VER
This diff is collapsed.
Click to expand it.
BaseLib/MemWatch.h
+
1
−
1
View file @
17bd284d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#ifndef MEMWATCH_H_
#ifndef MEMWATCH_H_
#define MEMWATCH_H_
#define MEMWATCH_H_
#ifndef
WIN32
#ifndef
_MSC_VER
#include
<sys/types.h>
#include
<sys/types.h>
#include
<unistd.h>
#include
<unistd.h>
...
...
This diff is collapsed.
Click to expand it.
BaseLib/RunTime.cpp
+
3
−
3
View file @
17bd284d
...
@@ -16,7 +16,7 @@ namespace BaseLib {
...
@@ -16,7 +16,7 @@ namespace BaseLib {
void
RunTime
::
start
()
void
RunTime
::
start
()
{
{
#ifndef _
WIN32
#ifndef _
MSC_VER
gettimeofday
(
&
_start
,
0
);
gettimeofday
(
&
_start
,
0
);
#else
#else
_start
=
timeGetTime
();
_start
=
timeGetTime
();
...
@@ -25,7 +25,7 @@ void RunTime::start()
...
@@ -25,7 +25,7 @@ void RunTime::start()
void
RunTime
::
stop
()
void
RunTime
::
stop
()
{
{
#ifndef _
WIN32
#ifndef _
MSC_VER
gettimeofday
(
&
_stop
,
0
);
gettimeofday
(
&
_stop
,
0
);
#else
#else
_stop
=
timeGetTime
();
_stop
=
timeGetTime
();
...
@@ -34,7 +34,7 @@ void RunTime::stop()
...
@@ -34,7 +34,7 @@ void RunTime::stop()
double
RunTime
::
elapsed
()
double
RunTime
::
elapsed
()
{
{
#ifndef _
WIN32
#ifndef _
MSC_VER
return
(
_stop
.
tv_sec
+
_stop
.
tv_usec
/
1000000.0
-
(
_start
.
tv_sec
+
_start
.
tv_usec
/
1000000.0
));
return
(
_stop
.
tv_sec
+
_stop
.
tv_usec
/
1000000.0
-
(
_start
.
tv_sec
+
_start
.
tv_usec
/
1000000.0
));
#else
#else
return
(
_stop
-
_start
)
/
1000.0
;
return
(
_stop
-
_start
)
/
1000.0
;
...
...
This diff is collapsed.
Click to expand it.
BaseLib/RunTime.h
+
2
−
2
View file @
17bd284d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include
"TimeMeasurementBase.h"
#include
"TimeMeasurementBase.h"
#ifndef _
WIN32
#ifndef _
MSC_VER
#include
<sys/time.h>
#include
<sys/time.h>
#else
#else
#include
<windows.h>
#include
<windows.h>
...
@@ -33,7 +33,7 @@ public:
...
@@ -33,7 +33,7 @@ public:
virtual
double
elapsed
();
virtual
double
elapsed
();
~
RunTime
()
{};
~
RunTime
()
{};
private
:
private
:
#ifndef _
WIN32
#ifndef _
MSC_VER
timeval
_start
;
timeval
_start
;
timeval
_stop
;
timeval
_stop
;
#else
#else
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment