From owner-freebsd-chat Thu Aug 9 20:56: 5 2001 Delivered-To: freebsd-chat@freebsd.org Received: from femail31.sdc1.sfba.home.com (femail31.sdc1.sfba.home.com [24.254.60.21]) by hub.freebsd.org (Postfix) with ESMTP id 3F2B937B406 for ; Thu, 9 Aug 2001 20:56:03 -0700 (PDT) (envelope-from tech_info@threespace.com) Received: from Atlanta.threespace.com ([24.21.224.204]) by femail31.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010810035602.VONO27087.femail31.sdc1.sfba.home.com@Atlanta.threespace.com> for ; Thu, 9 Aug 2001 20:56:02 -0700 Message-Id: <4.3.2.7.2.20010809225151.017e6580@threespace.com> X-Sender: tech@threespace.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 09 Aug 2001 23:55:45 -0400 To: FreeBSD Chat From: Technical Information Subject: calculating uptime Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I currently run Windows and Linux about evenly now, going several days at a time between voluntary reboots to switch to another OS. I got curious about how many of my reboots aren't voluntary (i.e., due to crashes/instability) so I started paying attention to the uptime. Since Windows has no uptime command, I downloaded a few available utilities designed to give the time since the OS was booted. The utilities I got seem to work differently. Some of them seem to calculate the difference between the current time and the boot time, and others seem to count the number of system ticks(*). Since I tend to put my computer to sleep while I'm not using it, this creates a pretty large discrepancy between the reported uptimes during the course of a week. My question is, what *is* the correct way to calculate uptime? Does the time that a computer is sleeping count? One the one hand it would seem that since the computer is idle that it shouldn't; on the other, since it can still respond to system events (and hence can still crash) it seems like it should count for something. What are your opinions? And what is the UNIX way? --Chip Morton (*) - And what the hell is a "tick" anyway? How many of these are there per second? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message