Created
May 15, 2019 05:16
-
-
Save tion-low/f6ec82ba3348dedd15ff58f7be8cd393 to your computer and use it in GitHub Desktop.
This file contains 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
import UIKit | |
import AVFoundation | |
var tb = mach_timebase_info() // イニシャライザ | |
mach_timebase_info(&tb) // こっちは関数呼び出し | |
let tsc = mach_absolute_time() | |
let t = Double(tsc) * Double(tb.numer) / Double(tb.denom) / 1000000000.0 | |
let seconds = AVAudioTime.seconds(forHostTime: tsc) | |
let cmtime = CMTime(seconds: seconds, preferredTimescale: 1000000000) | |
print(cmtime) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment