Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Time in iOS

No description
by

Cyril Lashkevich

on 13 March 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Time in iOS

Time in iOS
Cyril Lashkevich
iOS solution architect,
Viber

Wall time
Host time
NSDate/NSDateFormatter
CFDate/CFDateFormatter
UNIX: time_t, struct tm
NSTimeInterval
CFTimeInterval
CFAbsoluteTime
Reference dates:
Unix Time
1 January 1970, GMT
"Reference Date"
1 January 2001, GMT
#define NSTimeIntervalSince1970 \
978307200.0
http://www.unicode.org/reports/tr35/#Date_Format_Patterns
Unicode Technical Standard #35
Unicode Locale Data Markup Language (LDML)
Appendix F: Date Format Patterns
mach_time.h
uint64_t mach_absolute_time()
mach_timebase_info(mach_timebase_t);
mach_wait_until(uint64_t);
struct mach_timebase_info {
uint32_t numer;
uint32_t denom;
};
mach_timebase_info_data_t info;
mach_timebase_info(&info);
uint32_t hzms = (uint32_t)((uint64_t) 1000000 * info.denom
/ info.numer);

struct thread_time_constraint_policy policy;

policy.period = ptime * hzms;
policy.computation = 3 * hzms;
policy.constraint = policy.period;
policy.preemptible = true;

thread_policy_set(mach_thread_self(),
THREAD_TIME_CONSTRAINT_POLICY,
(thread_policy_t)&policy,
THREAD_TIME_CONSTRAINT_POLICY_COUNT));
Full transcript