标签:ios
NSString *savedTime = [[NSUserDefaults standardUserDefaults] stringForKey:@"time"]; NSString *time = [NSString stringWithFormat:@"%f", (double)[[NSDate date] timeIntervalSince1970]]; NSLog(@"\n%@\n%@",time,savedTime); NSLog(@"%.f",([time doubleValue] - [savedTime doubleValue]) * 1000); [[NSUserDefaults standardUserDefaults] setObject:time forKey:@"time"]; [[NSUserDefaults standardUserDefaults] synchronize];
标签:ios
原文地址:http://blog.csdn.net/rainlesvio/article/details/38271285