use nanotime instead of milliseconds