stephenbrooks.orgForumOtherProgramsUptime Counter
Username: Password:
Search site:
Subscribe to thread via RSS
kruemi [Swissteam.NET]
2002-07-10 07:56:45
Cool Program...
Why couldn't microsoft just add such a simple utility?  Hm, nobody will ever know!  .-/

Hm, but how much is 390hrs?  Ok, i can just divide by 24, but i think the computer can do this much faster!
Would it be possible, to also show the days instead of only hours?
A simple command-line-version would also be nice .-)

bye

kruemi

--
Don't read this.  And neither this!
Stephen Brooks
2002-07-11 05:26:51
OK, sure, I'll modify it to display days as well as hours.

The only trouble is that the Windows system clock wraps at 2^32 milliseconds, which is 49.7 days (1193 hours), so the days counter would never get above 49. There _is_ a possibility that I could compare the millisecond timer with the other internal clock, which runs in seconds since 1970. This would require that I save a file showing the difference of these two to disk.  If the program runs, finds this file and then sees that the difference between its value and the current one is close to a multiple of 49.7 days it could then adjust the readout accordingly.  This wouldn't be totally bulletproof though (e.g. what if you restarted you computer after exactly 49.7 days and ran the app again?) so for now I'll just upload the one with days counter.


"As every 11-year-old kid knows, if you concentrate enough Van-der-Graff generators and expensive special effects in one place, you create a spiral space-time whirly thing, AND an interesting plotline"
Stephen Brooks
2002-07-12 13:29:26
The uptime counter now reads in days when the number of hours is 24 or more.


"As every 11-year-old kid knows, if you concentrate enough Van-der-Graff generators and expensive special effects in one place, you create a spiral space-time whirly thing, AND an interesting plotline"
kruemi [Swissteam.NET]
2002-07-18 02:56:19
Great!
I just tested it!  Works fine on my Machine!

Thanx for this useful Program!

bye

kruemi

--
Don't read this.  And neither this!
DrHanser
2002-10-28 05:58:23
quote:
Originally posted by kruemi [Swissteam.NET]:
Cool Program...
Why couldn't microsoft just add such a simple utility?  Hm, nobody will ever know!  .-/

[snip]

Would it be possible, to also show the days instead of only hours?
A simple command-line-version would also be nice .-)


Microsoft does have such a utility, which runs at the commandline.

http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winntas/downloads/uptime.asp

Just save the executable to your %systemroot% directory for easiest use.

quote:
The only trouble is that the Windows system clock wraps at 2^32 milliseconds, which is 49.7 days (1193 hours), so the days counter would never get above 49. There _is_ a possibility that I could compare the millisecond timer with the other internal clock, which runs in seconds since 1970.


Stephen, do you know how exactly the uptime executable from MS runs?  My uptime at home is over 49 days, and the Microsoft program reads it correctly.  Also, I thought that this resetting bug was fixed in Windows 98SE, and hasn't been an issue since.  confused

--
The mark of an educated man is one who knows a lot about something, and a little about everything.
[DPC] Jive
2002-10-28 06:39:31
I know that on NT based machines there is a eventlog entry for the last boot they can read.

I don't know how this is set in 9x though.
Stephen Brooks
2002-10-28 06:50:09
There's actually an improved 64-bit counter supported on a lot of computer boards.  The current version of uptime I have reads from it, if present, so won't wrap for years.  I forget to post that upgrade to this thread though - maybe I discussed it with someone else via e-mail.


"As every 11-year-old kid knows, if you concentrate enough Van-der-Graff generators and expensive special effects in one place, you create a spiral space-time whirly thing, AND an interesting plotline"
DrHanser
2002-10-28 16:52:04
Oh well, my uptime is only 43 days right now.  When it gets over 49, I'll let y'all know.  razz

--
The mark of an educated man is one who knows a lot about something, and a little about everything.
Goner
2002-11-05 05:40:51
hi,

C:\utils>uptime_cmdline
83 days 22:11:57.-648 2014.20 hours B0332439 00208C33:91D22EA3
C:\utils>

is that a record for a Win2K server ?? 

Goner
Stephen Brooks
2002-11-11 10:06:27
I see my milli-seconds come out negative when it goes that high big grin


"As every 11-year-old kid knows, if you concentrate enough Van-der-Graff generators and expensive special effects in one place, you create a spiral space-time whirly thing, AND an interesting plotline"
Stephen Brooks
2003-01-26 05:00:44
Update: I've added a version that works as a popup counter in Windows, and also corrected the negative milliseconds bug in both versions.  The desktop version isn't 100% perfect but it works for most normal use, and doesn't take up much CPU (<1%) when you have it running in the background.  Be careful not to start 2 instances though.  See prefs.txt file for configurable options.

Uptime Counter Page


Err you know, if they made an extra-large black briefcase that also doubled as a 1-passenger car, some fool would complain it was too large to open at their desk
: contact : - - -
E-mail: sbstrudel characterstephenbrooks.orgTwitter: stephenjbrooksMastodon: strudel charactersjbstrudel charactermstdn.io RSS feed

Site has had 26852010 accesses.