You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the reason you want to add this?
The reason those exist in the darwin is to allow convenient conversion from/to core audio timestamps. There is no such "native" linux timestamp format. As far as I can tell any necessary conversions should be doable using std::chrono.
What is the reason you want to add this?
The reason those exist in the darwin is to allow convenient conversion from/to core audio timestamps. There is no such "native" linux timestamp format. As far as I can tell any necessary conversions should be doable using std::chrono.
Hm, I was under the impression somehow I should use ticks for time stamps. Not sure where I got that idea (maybe I copy-pasted some example code). I've used ticks through out the code base before I began porting to Linux. But if I understand you correctly, I should be using micros for the cross-platform code, and use ticksToMicros to convert mHostTime on macOS to micros?
ticks() just calls mach_absolute_time(). mach_absolute_time() should be used with caution. I.e. it behaves differently on arm and x86. So I would not recommend to use this as the general time unit for an app that is supposed to support multiple platforms. I.e. if you want to do some calculations using a sample rate value and time value, you will have to know the unit.
You can use mach_timebase_info to convert the result of mach_absolute_time() to nanoseconds.
In Link we use microseconds as a unit for time as this makes sense regarding accuracy and data being transmitted over the network.
If microseconds makes sense for your application you could use that. If you have other requirements something else might make more sense.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.