Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
miniaudio
Commits
2571009c
Commit
2571009c
authored
Apr 17, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental fix for -std=c99.
parent
c74ec332
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
miniaudio.h
miniaudio.h
+21
-0
No files found.
miniaudio.h
View file @
2571009c
...
@@ -4221,6 +4221,7 @@ double ma_timer_get_time_in_seconds(ma_timer* pTimer)
...
@@ -4221,6 +4221,7 @@ double ma_timer_get_time_in_seconds(ma_timer* pTimer)
return (emscripten_get_now() - pTimer->counterD) / 1000; /* Emscripten is in milliseconds. */
return (emscripten_get_now() - pTimer->counterD) / 1000; /* Emscripten is in milliseconds. */
}
}
#else
#else
#if _POSIX_C_SOURCE >= 199309L
#if defined(CLOCK_MONOTONIC)
#if defined(CLOCK_MONOTONIC)
#define MA_CLOCK_ID CLOCK_MONOTONIC
#define MA_CLOCK_ID CLOCK_MONOTONIC
#else
#else
...
@@ -4245,6 +4246,26 @@ double ma_timer_get_time_in_seconds(ma_timer* pTimer)
...
@@ -4245,6 +4246,26 @@ double ma_timer_get_time_in_seconds(ma_timer* pTimer)
return (newTimeCounter - oldTimeCounter) / 1000000000.0;
return (newTimeCounter - oldTimeCounter) / 1000000000.0;
}
}
#else
void ma_timer_init(ma_timer* pTimer)
{
struct timeval newTime;
gettimeofday(&newTime, NULL);
pTimer->counter = (newTime.tv_sec * 1000000) + newTime.tv_usec;
}
double ma_timer_get_time_in_seconds(ma_timer* pTimer)
{
struct timeval newTime;
gettimeofday(&newTime, NULL);
ma_uint64 newTimeCounter = (newTime.tv_sec * 1000000) + newTime.tv_usec;
ma_uint64 oldTimeCounter = pTimer->counter;
return (newTimeCounter - oldTimeCounter) / 1000000.0;
}
#endif
#endif
#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