Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
bae98299
Commit
bae98299
authored
Feb 22, 1994
by
Karl Heuer
Browse files
(get_time): Simplify; avoid calling index.
(main): exit on EOF.
parent
5a1a5fd7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
lib-src/profile.c
lib-src/profile.c
+3
-7
No files found.
lib-src/profile.c
View file @
bae98299
...
...
@@ -54,8 +54,6 @@ reset_watch ()
char
*
get_time
()
{
char
*
result
=
time_string
;
int
i
;
if
(
watch_not_started
)
return
((
char
*
)
0
);
/* call reset_watch first ! */
gettimeofday
(
&
TV2
,
tzp
);
...
...
@@ -64,10 +62,8 @@ get_time ()
TV2
.
tv_usec
+=
1000000
;
TV2
.
tv_sec
--
;
}
sprintf
(
result
,
"%lu.%6lu"
,
sprintf
(
time_string
,
"%lu.%
0
6lu"
,
TV2
.
tv_sec
-
TV1
.
tv_sec
,
TV2
.
tv_usec
-
TV1
.
tv_usec
);
for
(
result
=
index
(
result
,
'.'
)
+
1
;
*
result
==
' '
;
result
++
)
*
result
=
'0'
;
return
time_string
;
}
...
...
@@ -75,9 +71,8 @@ void
main
()
{
char
inp
[
10
];
while
(
1
)
while
(
gets
(
inp
)
)
{
gets
(
inp
);
switch
(
inp
[
0
])
{
case
'z'
:
...
...
@@ -90,4 +85,5 @@ main ()
exit
(
0
);
}
}
exit
(
1
);
}
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