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
fc92c667
Commit
fc92c667
authored
Jul 14, 2016
by
antirez
Browse files
LRU simulator: fix new entry creation decr time.
parent
f50dc38b
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/lru/lfu-simulation.c
View file @
fc92c667
...
@@ -137,7 +137,7 @@ int main(void) {
...
@@ -137,7 +137,7 @@ int main(void) {
if
(
new_entry_time
<=
now
)
{
if
(
new_entry_time
<=
now
)
{
idx
=
10
+
(
rand
()
%
10
);
idx
=
10
+
(
rand
()
%
10
);
entries
[
idx
].
counter
=
COUNTER_INIT_VAL
;
entries
[
idx
].
counter
=
COUNTER_INIT_VAL
;
entries
[
idx
].
decrtime
=
to_16bit_minutes
(
start
);
entries
[
idx
].
decrtime
=
to_16bit_minutes
(
time
(
NULL
)
);
entries
[
idx
].
hits
=
0
;
entries
[
idx
].
hits
=
0
;
entries
[
idx
].
ctime
=
time
(
NULL
);
entries
[
idx
].
ctime
=
time
(
NULL
);
new_entry_time
=
now
+
10
;
new_entry_time
=
now
+
10
;
...
...
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