added _nanotime_override() function to override the internal clock for the purposes of testing time based functinos