Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
timeout.c
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
Kirill Smelkov
timeout.c
Commits
d6f40621
Commit
d6f40621
authored
Jan 31, 2014
by
william
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
at clock op to bench.c
parent
bafeec9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
bench.c
bench.c
+15
-1
No files found.
bench.c
View file @
d6f40621
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
#include <locale.h>
#include <locale.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>
#include <dlfcn.h>
#include <dlfcn.h>
...
@@ -115,6 +117,10 @@ struct op *parseop(struct op *op, char *ln) {
...
@@ -115,6 +117,10 @@ struct op *parseop(struct op *op, char *ln) {
case
'n'
:
case
'n'
:
op
->
type
=
OP_NONE
;
op
->
type
=
OP_NONE
;
break
;
case
't'
:
op
->
type
=
OP_TIME
;
break
;
break
;
default:
default:
op
->
type
=
OP_OOPS
;
op
->
type
=
OP_OOPS
;
...
@@ -193,6 +199,9 @@ int main(int argc, char **argv) {
...
@@ -193,6 +199,9 @@ int main(int argc, char **argv) {
--
argc
;
--
argc
;
}
}
if
(
!
MAIN
.
verbose
)
setvbuf
(
stdout
,
NULL
,
_IOFBF
,
0
);
if
(
!
(
MAIN
.
timeout
=
calloc
(
MAIN
.
count
,
sizeof
*
MAIN
.
timeout
)))
if
(
!
(
MAIN
.
timeout
=
calloc
(
MAIN
.
count
,
sizeof
*
MAIN
.
timeout
)))
err
(
1
,
"calloc"
);
err
(
1
,
"calloc"
);
...
@@ -255,9 +264,14 @@ int main(int argc, char **argv) {
...
@@ -255,9 +264,14 @@ int main(int argc, char **argv) {
break
;
break
;
case
OP_FILL
:
case
OP_FILL
:
for
(
to
=
MAIN
.
timeout
;
to
<
&
MAIN
.
timeout
[
MAIN
.
count
];
to
++
)
{
for
(
to
=
MAIN
.
timeout
;
to
<
&
MAIN
.
timeout
[
MAIN
.
count
];
to
++
)
{
MAIN
.
vops
.
add
(
to
,
random
()
%
MAIN
.
maximum
);
MAIN
.
vops
.
add
(
to
,
arc4random_uniform
(
MAIN
.
maximum
));
//MAIN.vops.add(to, random() % MAIN.maximum);
}
}
break
;
case
OP_TIME
:
printf
(
"clock %ld
\n
"
,
clock
());
break
;
break
;
case
OP_NONE
:
case
OP_NONE
:
break
;
break
;
...
...
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