Added _gettimeofday function based on system timer
Use usleep for delays
Support user-defined buffer size and 16bit samples