Function to get the current system time in nanoseconds.