Posted By

haureal on 12/29/10

Tagged

Viewed 0 times

How to create an absolute timeout in GCD


/ Published in: C


  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.