ashwin / coursera-heterogeneous

Resources to work offline on the assignments of Heterogenous Parallel Programming course from Coursera.
71 stars 60 forks source link

Fixed time functions to work also on MacOS/FreeBSD. #8

Closed iemejia closed 11 years ago

iemejia commented 11 years ago

Fixed time functions to work also on MacOS/FreeBSD.

No nanosecond precision supported for MacOS/FreeBSD, for more info see:

http://laclefyoshi.blogspot.com/2011/05/getting-nanoseconds-in-c-on-freebsd.ht http://www.wanderinghill.com/wp/?p=29

ashwin commented 11 years ago

@iemejia Merged in. Thanks! :+1:

ashwin commented 11 years ago

@iemejia Sorry, I had to rollback your changes. It gives compilation error on Ubuntu. _POSIX_TIMERS seems to be defined on Ubuntu/Linux too.

If you can fix it such that clock_gettime is used only on Mac/FreeBSD, give me a pull request. :smiley: