use time_ns for duration-based timing. fixes #2464