Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
sofia-sip
Commits
adb6c374
Commit
adb6c374
authored
Aug 23, 2006
by
Pekka Pessi
Browse files
su_timer_test.c: added -N option.
darcs-hash:20060823131641-65a35-092563d814b89d26eaf79248e547a827ae7fb96d.gz
parent
327f59bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
libsofia-sip-ua/su/su_timer_test.c
View file @
adb6c374
...
@@ -124,7 +124,7 @@ increment(struct tester *tester, su_timer_t *t, struct timing *ti)
...
@@ -124,7 +124,7 @@ increment(struct tester *tester, su_timer_t *t, struct timing *ti)
void
void
usage
(
char
const
*
name
)
usage
(
char
const
*
name
)
{
{
fprintf
(
stderr
,
"usage: %s [-1r] [interval]
\n
"
,
name
);
fprintf
(
stderr
,
"usage: %s [-1r]
[-Nnum]
[interval]
\n
"
,
name
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -143,22 +143,30 @@ int main(int argc, char *argv[])
...
@@ -143,22 +143,30 @@ int main(int argc, char *argv[])
char
*
s
;
char
*
s
;
int
use_t1
=
0
;
int
use_t1
=
0
;
su_time_t
now
,
started
;
su_time_t
now
,
started
;
intptr_t
i
,
N
;
intptr_t
i
,
N
=
500
;
struct
timing
timing
[
1
]
=
{{
0
}};
struct
timing
timing
[
1
]
=
{{
0
}};
struct
tester
tester
[
1
]
=
{{
0
}};
struct
tester
tester
[
1
]
=
{{
0
}};
while
(
argv
[
1
]
&&
argv
[
1
][
0
]
==
'-'
)
{
while
(
argv
[
1
]
&&
argv
[
1
][
0
]
==
'-'
)
{
char
*
o
=
argv
[
1
]
+
1
;
char
*
o
=
argv
[
1
]
+
1
;
while
(
*
o
)
while
(
*
o
)
{
if
(
*
o
==
'1'
)
if
(
*
o
==
'1'
)
o
++
,
use_t1
=
1
;
o
++
,
use_t1
=
1
;
else
if
(
*
o
==
'r'
)
else
if
(
*
o
==
'r'
)
o
++
,
timing
->
t_run
=
1
;
o
++
,
timing
->
t_run
=
1
;
else
if
(
*
o
==
'N'
)
{
if
(
o
[
1
])
N
=
strtoul
(
o
+
1
,
&
o
,
0
);
else
if
(
argv
[
2
])
N
=
strtoul
(
argv
++
[
2
],
&
o
,
0
);
break
;
}
else
else
break
;
break
;
if
(
o
==
argv
[
1
]
+
1
)
}
if
(
*
o
)
usage
(
argv0
);
usage
(
argv0
);
argv
++
;
argv
++
;
}
}
...
@@ -220,8 +228,8 @@ int main(int argc, char *argv[])
...
@@ -220,8 +228,8 @@ int main(int argc, char *argv[])
return
1
;
return
1
;
}
}
/* Insert
500
timers in order */
/* Insert timers in order */
timers
=
calloc
(
N
=
500
,
sizeof
*
timers
);
timers
=
calloc
(
N
,
sizeof
*
timers
);
if
(
!
timers
)
{
perror
(
"calloc"
);
exit
(
1
);
}
if
(
!
timers
)
{
perror
(
"calloc"
);
exit
(
1
);
}
now
=
started
=
su_now
();
now
=
started
=
su_now
();
...
...
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