Copied functions to calculate uptime and wid to return uptime