Problem
#34328 switched uptime to use monotonic time, but g_startup_time was a function-local static in GetUptime(), meaning it was initialized on first call rather than at program start.
This caused the first uptime RPC to always return 0.
Fix
Move g_startup_time to namespace scope so it initializes at program start, ensuring the first uptime() call returns actual elapsed time.
Reproducer
Revert the fix and run the test or alternatively:
0cmake -B build && cmake --build build --target bitcoind bitcoin-cli -j$(nproc)
1./build/bin/bitcoind -regtest -daemon
2sleep 10
3./build/bin/bitcoin-cli -regtest uptime
4./build/bin/bitcoin-cli -regtest stop
0Bitcoin Core starting
10
2Bitcoin Core stopping
0Bitcoin Core starting
110
2Bitcoin Core stopping
Fixes #34423, added reporter as coauthor.