Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a5d6a691
Commit
a5d6a691
authored
Feb 18, 2008
by
jani@hynda.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a previous patch.
parent
c7e04cfe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
26 deletions
+15
-26
.bzrignore
.bzrignore
+1
-0
client/mysqltest.c
client/mysqltest.c
+1
-1
include/config-win.h
include/config-win.h
+3
-1
mysys/my_getsystime.c
mysys/my_getsystime.c
+10
-24
No files found.
.bzrignore
View file @
a5d6a691
...
...
@@ -3012,3 +3012,4 @@ win/vs8cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
libmysqld/sql_profile.cc
client/mysqltest.c
View file @
a5d6a691
...
...
@@ -7330,7 +7330,7 @@ void timer_output(void)
ulonglong
timer_now
(
void
)
{
return
my_
getsystime
()
/
10
000
;
return
my_
micro_time
()
/
1
000
;
}
...
...
include/config-win.h
View file @
a5d6a691
...
...
@@ -257,9 +257,11 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#endif
#define STACK_DIRECTION -1
/* Difference between GetSystemTimeAsFileTime() and now() */
#define OFFSET_TO_EPOCH ULL(116444736000000000)
/* Optimized store functions for Intel x86 */
#ifndef _WIN64
...
...
mysys/my_getsystime.c
View file @
a5d6a691
...
...
@@ -41,7 +41,7 @@ ulonglong my_getsystime()
{
QueryPerformanceCounter
(
&
t_cnt
);
return
((
t_cnt
.
QuadPart
/
query_performance_frequency
*
10000000
)
+
(
t_cnt
.
QuadPart
%
query_performance_frequency
*
10000000
/
(
(
t_cnt
.
QuadPart
%
query_performance_frequency
)
*
10000000
/
query_performance_frequency
)
+
query_performance_offset
);
}
return
0
;
...
...
@@ -108,21 +108,14 @@ time_t my_time(myf flags __attribute__((unused)))
ulonglong
my_micro_time
()
{
ulonglong
newtime
;
#if defined(__WIN__)
if
(
query_performance_frequency
)
{
QueryPerformanceCounter
((
LARGE_INTEGER
*
)
&
newtime
);
return
((
newtime
/
query_performance_frequency
*
10000000
)
+
(
newtime
%
query_performance_frequency
*
10000000
/
query_performance_frequency
));
}
else
newtime
=
(
GetTickCount
()
*
1000
);
/* GetTickCount only returns millisec */
return
newtime
;
ulonglong
newtime
;
GetSystemTimeAsFileTime
((
FILETIME
*
)
&
newtime
);
return
(
newtime
/
10
);
#elif defined(HAVE_GETHRTIME)
return
gethrtime
()
/
1000
;
#else
ulonglong
newtime
;
struct
timeval
t
;
/*
The following loop is here because gettimeofday may fail on some systems
...
...
@@ -161,19 +154,11 @@ ulonglong my_micro_time()
ulonglong
my_micro_time_and_time
(
time_t
*
time_arg
)
{
ulonglong
newtime
;
#if defined(__WIN__)
if
(
query_performance_frequency
)
{
QueryPerformanceCounter
((
LARGE_INTEGER
*
)
&
newtime
);
return
((
newtime
/
query_performance_frequency
*
10000000
)
+
(
newtime
%
query_performance_frequency
*
10000000
/
query_performance_frequency
));
}
else
newtime
=
(
GetTickCount
()
*
1000
);
/* GetTickCount only returns millisec. */
(
void
)
time
(
time_arg
);
return
newtime
;
ulonglong
newtime
;
GetSystemTimeAsFileTime
((
FILETIME
*
)
&
newtime
);
*
time_arg
=
(
newtime
-
OFFSET_TO_EPOCH
)
/
10000000
;
return
(
newtime
/
10
);
#elif defined(HAVE_GETHRTIME)
/*
Solaris has a very slow time() call. We optimize this by using the very
...
...
@@ -194,6 +179,7 @@ ulonglong my_micro_time_and_time(time_t *time_arg)
pthread_mutex_unlock
(
&
THR_LOCK_time
);
return
cur_gethrtime
/
1000
;
#else
ulonglong
newtime
;
struct
timeval
t
;
/*
The following loop is here because gettimeofday may fail on some systems
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment