Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Aug 2001 20:33:55 +0100
From:      Mark Ovens <marko@freebsd.org>
To:        Technical Information <tech_info@threespace.com>
Cc:        FreeBSD Chat <chat@freebsd.org>
Subject:   Re: calculating uptime
Message-ID:  <20010811203355.A295@parish>
In-Reply-To: <4.3.2.7.2.20010811140656.0181bc88@threespace.com>; from tech_info@threespace.com on Sat, Aug 11, 2001 at 02:16:15PM -0400
References:  <4.3.2.7.2.20010809225151.017e6580@threespace.com> <4.3.2.7.2.20010809225151.017e6580@threespace.com> <20010811165908.B275@parish> <4.3.2.7.2.20010811140656.0181bc88@threespace.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Aug 11, 2001 at 02:16:15PM -0400, Technical Information wrote:
> At 11:59 AM 8/11/2001, Mark Ovens wrote:
> >On Thu, Aug 09, 2001 at 11:55:45PM -0400, Technical Information wrote:
> > > I currently run Windows and Linux about evenly now,
> >
> >What about FreeBSD?
> 
> The XFree86 3.3.6 included with the latest shipping version of FreeBSD 4.3 
> didn't have drivers for my fancy Voodoo 5 video card.  So until I figure 
> out how to install XFree86 4.1 on FreeBSD without using sysintall, I'm 
> running Red Hat 7.1.  Interestingly, I do occasionally run FreeBSD in 
> emulation on the Red Hat system.
> 
> 
> 
> > > 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,
> >
> >W2K does, although it cheats. If you "suspend to disk" and then resume it 2
> >weeks later it includes those 2 weeks in the uptime.
> 
> So what about FreeBSD and other forms of UNIX?  Do they increment their 
> uptime while they sleep?

Yes. Looking at the source for uptime(1) it just subtracts the kernel boot
time from the current time. W2K's Suspend To Disk is different to sleeping
though. It writes an image of memory to a disk file and then shuts down.
You can then boot another OS or even power off the machine. When you reboot
W2K it reads back the memory image thus restoring the OS (and all your
running apps) to the state they were in at shutdown. Therefore the OS most
definitely isn't running so the time it is suspended to disk should not be
included in the uptime.

Guess this is the only way W2K can achieve Unix-like uptimes :-)

Someone on these lists has/had the .sig "Unix measures uptimes in years,
Windows measures it in minutes"

> I mean, in some respects it seems fair.  The 
> system is sleeping, not completely off.  Much in the same way that you 
> still age while you sleep, so the age of a 36-year-old still include the 12 
> or so years during which that person has slept.
> 
> What brought about my question is that the Windows utilities that I 
> downloaded exhibit different behaviour in this regard, and I'm wondering 
> which is really "correct."  I've never put a UNIX system to sleep, but how 
> does UNIX do it?
> 
> 
> 
> > > 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?
> > >
> >
> >By "sleeping" I presume that you mean Power Management/Energy Saving
> >features? As you quite rightly point out the OS is still running it's just
> >that the CPU is "slowed down" and disks are spun down etc. so this should
> >count as uptime, the OS can still respond to system events as you point out
> >and, I would imagine, Windows could die in it's sleep ;-)
> 
> Yes, Windows can die in it's sleep.  I've had this happen a number of times 
> on various computers.  And many of them will go to sleep and not wake 
> up.  Wonder if they're still increasing they're uptime when they're 
> terminally comatose like this. ;-)
> 

I thought "terminally comatose" was the normal state for Windows ;-)

> --Chip Morton
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-chat" in the body of the message

-- 
		4.4 - The number of the Beastie
________________________________________________________________
51.44°N  FreeBSD - The Power To Serve http://www.freebsd.org
2.057°W  My Webpage http://ukug.uk.freebsd.org/~mark
mailto:marko@freebsd.org                http://www.radan.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010811203355.A295>