Posted By

haureal on 12/29/10


Tagged

gcd dispatch


Versions (?)

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  

You need to login to post a comment.