At 13.42 +0200 2000.05.29, Thomas Wegner wrote: >which reads out the global variable 'Ticks' (you may also use 'LMGetTicks' >from the modul LowMem.pm). Since low memory access is basically going away in Mac OS X and Carbon, I'd stay away from it. >Now, you need the startup date/time. The current time is stored in the >low-memory global variable 'Time'. This variable contains the seconds since >midnight, Jan 1, 1904 (a longInt value). You will use the routine LMGetTime >(see LowMem.pm) to get the value. In MacPerl, of course, you may also use >the Perl builtin function time(). Same caveat. >use Mac::LowMem; >$current_Time = time; # LMGetTime; >$startup_Ticks = LMGetTicks; Safer: use Mac::Events; $current_Time = time; $startup_Ticks = TickCount; BTW, here is an uptime script I wrote a few weeks ago, which gives you the same info, plus some: #!perl -w use Mac::Events; $ticks = TickCount(); $days = $ticks / 5184000; $hours = ($days - int($days)) * 24; $minutes = ($hours - int($hours)) * 60; $seconds = ($minutes - int($minutes)) * 60; printf "Computer started up at %s\n", scalar localtime(time - ($ticks / 60)); printf "Computer has been up for %d days, %.2d:%.2d:%.2d\n", $days, $hours, $minutes, $seconds; -- Chris Nandor | pudge@pobox.com | http://pudge.net/ Andover.Net | chris.nandor@andover.net | http://slashcode.com/ # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org