Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
d9b63547
Commit
d9b63547
authored
Jun 10, 2014
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
htable: update tools for time changes.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
95ff2139
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
ccan/htable/tools/hsearchspeed.c
ccan/htable/tools/hsearchspeed.c
+4
-4
ccan/htable/tools/speed.c
ccan/htable/tools/speed.c
+4
-4
ccan/htable/tools/stringspeed.c
ccan/htable/tools/stringspeed.c
+4
-4
No files found.
ccan/htable/tools/hsearchspeed.c
View file @
d9b63547
...
...
@@ -15,17 +15,17 @@
#include <search.h>
/* Nanoseconds per operation */
static
size_t
normalize
(
const
struct
time
spec
*
start
,
const
struct
time
spec
*
stop
,
static
size_t
normalize
(
const
struct
time
abs
*
start
,
const
struct
time
abs
*
stop
,
unsigned
int
num
)
{
return
time_to_nsec
(
time_divide
(
time_
sub
(
*
stop
,
*
start
),
num
));
return
time_to_nsec
(
time_divide
(
time_
between
(
*
stop
,
*
start
),
num
));
}
int
main
(
int
argc
,
char
*
argv
[])
{
size_t
i
,
j
,
num
;
struct
time
spec
start
,
stop
;
struct
time
abs
start
,
stop
;
char
**
w
;
ENTRY
*
words
,
*
misswords
;
...
...
ccan/htable/tools/speed.c
View file @
d9b63547
...
...
@@ -94,11 +94,11 @@ static size_t count_deleted(const struct htable *ht)
}
/* Nanoseconds per operation */
static
size_t
normalize
(
const
struct
time
spec
*
start
,
const
struct
time
spec
*
stop
,
static
size_t
normalize
(
const
struct
time
abs
*
start
,
const
struct
time
abs
*
stop
,
unsigned
int
num
)
{
return
time_to_nsec
(
time_divide
(
time_
sub
(
*
stop
,
*
start
),
num
));
return
time_to_nsec
(
time_divide
(
time_
between
(
*
stop
,
*
start
),
num
));
}
static
size_t
worst_run
(
struct
htable
*
ht
,
size_t
*
deleted
)
...
...
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
{
struct
object
*
objs
;
size_t
i
,
j
,
num
,
deleted
;
struct
time
spec
start
,
stop
;
struct
time
abs
start
,
stop
;
struct
htable_obj
ht
;
bool
make_dumb
=
false
;
...
...
ccan/htable/tools/stringspeed.c
View file @
d9b63547
...
...
@@ -34,17 +34,17 @@ static bool cmp(const char *obj, const char *key)
HTABLE_DEFINE_TYPE
(
char
,
strkey
,
hash_str
,
cmp
,
htable_str
);
/* Nanoseconds per operation */
static
size_t
normalize
(
const
struct
time
spec
*
start
,
const
struct
time
spec
*
stop
,
static
size_t
normalize
(
const
struct
time
abs
*
start
,
const
struct
time
abs
*
stop
,
unsigned
int
num
)
{
return
time_to_nsec
(
time_divide
(
time_
sub
(
*
stop
,
*
start
),
num
));
return
time_to_nsec
(
time_divide
(
time_
between
(
*
stop
,
*
start
),
num
));
}
int
main
(
int
argc
,
char
*
argv
[])
{
size_t
i
,
j
,
num
;
struct
time
spec
start
,
stop
;
struct
time
abs
start
,
stop
;
struct
htable_str
ht
;
char
**
words
,
**
misswords
;
...
...
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