Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Print CMTime in objective C

I have some experience of swift, but zero knowledge on objective C
I need to print a timestamp in the console,
here it is:

  CMTime timeStamp = CMTimeMake(frame.timeStampNs / rtc::kNumNanosecsPerMillisec, 1000);

I added something like that:

NSLog(@timeStamp);

But it’s failed, I need to print something like that in swift:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

print("Timestamp: \(timeStamp)"

Could you please tell me how to do it on objective c?

Thanks

>Solution :

Use the format specifier %f for 64-bit floating-point numbers (double)

NSLog("Timestamp: %f", CMTimeGetSeconds(timeStamp));

https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading