Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a8866004
Commit
a8866004
authored
Jun 09, 2007
by
Roger Bystrøm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added timer_get_runtime_ms to know how long the timer has been running
git-svn-id:
https://svn.musicpd.org/mpd/trunk@6521
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
9ccf0d8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
timer.c
src/timer.c
+7
-1
timer.h
src/timer.h
+3
-0
No files found.
src/timer.c
View file @
a8866004
...
...
@@ -51,7 +51,7 @@ void timer_free(Timer *timer)
void
timer_start
(
Timer
*
timer
)
{
timer
->
time
=
now
();
timer
->
start_time
=
timer
->
time
=
now
();
timer
->
started
=
1
;
}
...
...
@@ -59,6 +59,7 @@ void timer_reset(Timer *timer)
{
timer
->
time
=
0
;
timer
->
started
=
0
;
timer
->
start_time
=
0
;
}
void
timer_add
(
Timer
*
timer
,
int
size
)
...
...
@@ -78,3 +79,8 @@ void timer_sync(Timer *timer)
if
(
sleep
>
0
)
my_usleep
(
sleep
);
}
int
timer_get_runtime_ms
(
Timer
*
timer
)
{
return
(
now
()
-
timer
->
start_time
)
/
1000
;
}
src/timer.h
View file @
a8866004
...
...
@@ -23,6 +23,7 @@
#include "mpd_types.h"
typedef
struct
_Timer
{
uint64_t
start_time
;
uint64_t
time
;
int
started
;
int
rate
;
...
...
@@ -40,4 +41,6 @@ void timer_add(Timer *timer, int size);
void
timer_sync
(
Timer
*
timer
);
int
timer_get_runtime_ms
(
Timer
*
timer
);
#endif
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