chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] R7RS: (current-jiffy) and (jiffies-per-second)


From: Alex Shinn
Subject: Re: [Chicken-users] R7RS: (current-jiffy) and (jiffies-per-second)
Date: Tue, 11 Mar 2014 10:18:05 +0900

On Sun, Mar 9, 2014 at 7:51 PM, Daniel Carrera <address@hidden> wrote:
Hello,

I hope nobody minds an R7RS question. This list seems to have people knowledgeable of R7RS. It seems weird that R7RS would specify the functions:

There's also address@hidden but
I doubt people mind here.

(current-jiffy)  -->  An exact integer representing the number of jiffies (arbitrary unit of time) since some arbitrary epoch.

(jiffies-per-second) --> Integer representing the number of jiffies in one second.


What could possibly be the value of these functions, given that R7RS already specifies (current-second) as the number of seconds since the Unix epoch? This seems like an oddly useless concept for a language that tries to be minimalist.

There are actually a number of motivations for this.
(current-second) is expensive, and in the presence
of NTP not guaranteed to be monotonic.  It will also
generally cons to return a bignum or flonum, whereas
current-jiffy could always return fixnums.

In general, for timing you want to use jiffies, and
for calendar operations you want want seconds.

The utility is not disputed.  Whether this belongs
in the small language is debatable (as is _everything_),
but it's there and is easy to implement.

-- 
Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]