Technology

Objective-C 에서 Time Interval 구하기.

Objective-C에서 NSDate와 NSTimeInterval을 사용하여 시간 간격을 구하는 방법을 알아보세요. 이 간단한 코드 예제를 통해 앱 개발 시 시간 측정 기능을 쉽게 구현할 수 있습니다.

Sangrak
NSDate *start = [NSDate date];
//.
//. (Your Code)
//.
NSTimeInterval timeInterval = [start timeIntervalSinceNow];
NSLog([NSString stringWithFormat:"%@%f seconds\r\n", output.text, timeInterval * -1]);

이 주제에 대한 다른 글