Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
33d2761b
Commit
33d2761b
authored
Jul 01, 2011
by
antirez
Browse files
ustime() backported from unstable, used by slow log
parent
ad6347b7
Changes
2
Show whitespace changes
Inline
Side-by-side
src/redis.h
View file @
33d2761b
...
@@ -869,6 +869,7 @@ int ll2string(char *s, size_t len, long long value);
...
@@ -869,6 +869,7 @@ int ll2string(char *s, size_t len, long long value);
int
isStringRepresentableAsLong
(
sds
s
,
long
*
longval
);
int
isStringRepresentableAsLong
(
sds
s
,
long
*
longval
);
int
isStringRepresentableAsLongLong
(
sds
s
,
long
long
*
longval
);
int
isStringRepresentableAsLongLong
(
sds
s
,
long
long
*
longval
);
int
isObjectRepresentableAsLongLong
(
robj
*
o
,
long
long
*
llongval
);
int
isObjectRepresentableAsLongLong
(
robj
*
o
,
long
long
*
llongval
);
long
long
ustime
(
void
);
/* Configuration */
/* Configuration */
void
loadServerConfig
(
char
*
filename
);
void
loadServerConfig
(
char
*
filename
);
...
...
src/util.c
View file @
33d2761b
#include "redis.h"
#include "redis.h"
#include <ctype.h>
#include <ctype.h>
#include <limits.h>
#include <limits.h>
#include <sys/time.h>
/* Glob-style pattern matching. */
/* Glob-style pattern matching. */
int
stringmatchlen
(
const
char
*
pattern
,
int
patternLen
,
int
stringmatchlen
(
const
char
*
pattern
,
int
patternLen
,
...
@@ -241,3 +242,14 @@ int isObjectRepresentableAsLongLong(robj *o, long long *llongval) {
...
@@ -241,3 +242,14 @@ int isObjectRepresentableAsLongLong(robj *o, long long *llongval) {
return
isStringRepresentableAsLongLong
(
o
->
ptr
,
llongval
);
return
isStringRepresentableAsLongLong
(
o
->
ptr
,
llongval
);
}
}
}
}
/* Return the UNIX time in microseconds */
long
long
ustime
(
void
)
{
struct
timeval
tv
;
long
long
ust
;
gettimeofday
(
&
tv
,
NULL
);
ust
=
((
long
long
)
tv
.
tv_sec
)
*
1000000
;
ust
+=
tv
.
tv_usec
;
return
ust
;
}
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