How to create an absolute timeout in GCD


/ Published in: C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. struct tm tm = {};
  2. strptime("2009-06-11 10:15", "%Y-%m-%d %H:%M", &tm);
  3.  
  4. struct timespec ts = {};
  5. ts.tv_sec = mktime(&tm);
  6.  
  7. dispatch_time_t timeout = dispatch_walltime(&ts, 0);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.