Thursday, September 2, 2010
Subscribe to Email Digest
 
Scripting Additions
Craig Williams [staff] Scripting Additions | Upload Scripting Additions
Home >> Scripting Additions >> Finder-System >> timetools

timetools 0.2.1 Script Rating
Freeware | Version: 0.2.1 | Osax id: 381
Author: andreb | Developer's Web Site
Category: Finder-System
timetools -- Tools for outputting time in various forms

USAGE: timetools [-v] [-h] [-verbose] -<flag>|diff "<starttime>" "<endtime>"

Measure/calculate time to varying precision, based on different reference points.

-<flag>

A flag is comprised of a category character and
a combination of one or more precision specifiers.

currently, there are 9 categories available:
s... time, based on reference date 01/01/2001, incl. decimal component
n... time, based on 01/01/2001, as fully scaled integer
d... same as n, but outputs the decimal component only
f... time, based on the reference date 01/01/1970
t... timestamp with format "hh:mm:ss" plus optional .<precision> part
g... offset from GMT
y... time, since system startup
u... up time (basically same as y, but uses diff. API)
l... timetools processing time, since program launch

precision specifiers:
d = deci- (10th)
c = centi- (100th)
m = milli- (1000th)
u = micro- (1000000th)
n = nano- (1000000000th)
s = seconds (1)
tc = ticks (1/60th second)

following combinations are available:
s... sms, scms, sus
n... nds, ncs, nms, ndms, ncms, nus
d... dds, dcs, dms, ddms, dcms, dus, ds
f... fs, fms, fus
t... ts, tds, tcs, tms, tdms, tcms, tus
g... gs, gms
y... ytc, yus
u... ums, uus, uns
l... ls, lms, lus

-diff

Calculate the difference between two colon-delimited
24hr time strings (e.g. "20:00:05" and "21:12:22")
The first parameter must represent a base time
and the second parameter must denote a future time


OPTIONS:

-v, --version Display version and exit

-h, --help Display this help and exit

-verbose Verbose output


EXAMPLES:

timetools -ytc => 435241 (tick count s. system startup)
timetools -uns => 1179046910610 (up time in nanoseconds)
timetools -tms => 11:56:57.883
timetools -verbose -ls => verbose mode on
timetools processing time in seconds:
0.004958

timetools -diff "20:00:05" "21:12:22" => 01:12:17

timetools -v => timetools version 0.2


DISCLAIMER:

This program comes with ABSOLUTELY NO WARRANTY
For full disclaimer, see enclosed README


Created by André Berg on 2008-09-11.
Copyright 2008 Berg Media. All rights reserved.
Version Changes: v0.2.1

(*) small bug fix for the -diff function.
(*) microseconds precision was still based on GMT time in one rare occasion. fixed.

v0.2:

(*) times based on reference dates are now properly adjusted for GMT offset as specified by the system.

(+) the t... category was added to print NSLog-like timestamps.

(+) the g... category was added to access the current offset from GMT as set by the system

v0.1:

( ) initial release
Click to View Dictionary
Downloads | This Version: 901 | All Previous Versions: 1 Show More files from this Author?
Reviews: [Add Your Review]
Generated in 0.089 secs | Total entries: 200 | Views: 868306