time_ns() uses uv_hrtime(), which is guaranteed to be monotonic (mod 2⁶⁴, so that time differences will increase monotonically as long as the system is running).
See also the discussion in tic() should use monotonic clock · Issue #2464 · JuliaLang/julia · GitHub … I submitted a PR to clarify the documentation for time_ns: clarify that time_ns is monotonic by stevengj · Pull Request #57129 · JuliaLang/julia · GitHub
(time_ns almost surely uses the same underlying system call as std::chrono::steady_clock. e.g. it uses the POSIX clock_gettime(CLOCK_MONOTONIC, &t) function on Unix. This is not “the calendar time since the UNIX epoch”, by the way … it’s usually related to time since the last reboot as you noted, though its behavior on system sleep is OS-dependent.)