use nanoseconds everywhere for timeout computation