Use clock_gettime() when available and get rid of deprecated gettimeofday()

gettimeofday () fails on latest ruby 2.0.0 on arch linux, clock_gettime () is supposed to be platform specific though.

Tested successfully on:
- Arch Linux (ruby 1.8.7, 1.9.3, 2.0.0-p195)