For Gauche 0.9.15Search (procedure/syntax/module):

Next: , Previous: , Up: ライブラリモジュール - SRFI   [Contents][Index]

11.36 srfi.174 - POSIX timespecs

Module: srfi.174

註: このsrfiはSRFI-170 (srfi.170 - POSIX API参照)で使うための補助ライブラリとして 作られたのですが、その後の議論で不十分であることがわかりました。 特に、SRFI-19の時間の型をコンストラクタで指定することが不可欠だとわかったのです。

従って、このsrfiは将来のsrfiで置き換えられる可能性が高く、使用は非推奨です。 ポータブルな時間の表現が必要であれば、SRFI-19を使ってください (srfi.19 - 時間のデータ型と手続き参照)。

Function: timespec secs nsecs

[SRFI-174]{srfi.174} Creates and returns a timespec, whose second part is secs and nanosecond part is nsecs. The second part must be an exact integer; if it is positive, it’s the number of seconds since Epoch (Jan 1, 1970 UTC), and if it’s negative, it’s before the Epoch. The nanosecond part is a nonnegative integer less than 1e9, and represents the fraction of seconds in nanosecond resolution. Note that if the second part is negative, the nanosecond part counts toward past.

This is the same as (make-time time-utc nsecs secs) of SRFI-19. Note the order of arguments.

Function: timespec? obj

[SRFI-174]{srfi.174} Returns #t iff obj is a <time> object. It doesn’t check the type of time.

Function: timespec-seconds ts
Function: timespec-nanosecods ts

[SRFI-174]{srfi.174} Returns second and nanosecond part of the <time> object. Same as time-second and time-nanosecond of SRFI-19 (note that we use plurals in this srfi).

Function: inexact->timespec v

[SRFI-174]{srfi.174} Convert an inexact real number v to a timespec. The integral part of v is the seconds after (when v is positive) or before (when v is negative) the Epoch, and the fractional part is rounded into nanosecond resolution.

Function: timespec->inexact ts

[SRFI-174] Convert a timespec into an inexact real number in seconds. {srfi.174}

Function: timespec=? ts1 ts2

[SRFI-174]{srfi.174} Returns #t iff two timespecs are the same. It is the same as time=? in SRFI-19.

Function: timespec<? ts1 ts2

[SRFI-174]{srfi.174} Returns #t iff a timespec ts1 is strictly before the timespec ts2. It is the same as time<? in SRFI-19.

Function: timespec-hash ts

[SRFI-174]{srfi.174} Compute a hash value of a timespec ts. It is same as passing a <time> object to default-hash, and affected by the current hash salt value (see ハッシュ).


Next: , Previous: , Up: ライブラリモジュール - SRFI   [Contents][Index]


For Gauche 0.9.15Search (procedure/syntax/module):