eygle.com   eygle.com
eygle.com  
 

« November 18, 2004 | Blog首页 | November 21, 2004 »



November 19, 2004

Man Page Of gethrtime

作者:eygle

出处:http://blog.eygle.com

题注:Man Page这里我辑录一些我在学习研究过程中关注过,应用过的,供自己参考,也希望可以见证自己的学习历程。

$ man gethrtime

Standard C Library Functions gethrtime(3C)

NAME
gethrtime, gethrvtime - get high resolution time

SYNOPSIS
#include

hrtime_t gethrtime(void);

hrtime_t gethrvtime(void);

DESCRIPTION
The gethrtime() function returns the current high-resolution real time. Time is expressed as
nanoseconds since some arbitrary time in the past; it is not correlated in any way to the time
of day, and thus is not subject to resetting or drifting by way of adjtime(2) or settimeofday(3C).
The hires timer is ideally suited to performance measurement tasks, where cheap, accurate
interval timing is required.

The gethrvtime() function returns the current high-resolution LWP virtual time, expressed
as total nanoseconds of execution time. This function requires that micro state accounting be
enabled with the ptime utility (see proc(1)).

The gethrtime() and gethrvtime() functions both return an hrtime_t, which is a 64-bit (long long)
signed integer.

EXAMPLES
The following code fragment measures the average cost of getpid(2):

hrtime_t start, end;
int i, iters = 100;

start = gethrtime();
for (i = 0; i < iters; i++)
getpid();
end = gethrtime();

printf("Avg getpid() time = %lld nsec\n", (end - start) / iters);

ATTRIBUTES
See attributes(5) for descriptions of the following attributes:

____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| MT-Level | MT-Safe |
|_____________________________|_____________________________|

SunOS 5.8 Last change: 10 Apr 1997 1

Standard C Library Functions gethrtime(3C)

SEE ALSO
proc(1), adjtime(2), gettimeofday(3C), settimeofday(3C), attributes(5)

NOTES
Although the units of hi-res time are always the same (nanoseconds), the actual resolution is
hardware dependent. Hi-res time is guaranteed to be monotonic (it won't go backward, it won't periodically
wrap) and linear (it won't occasionally speed up or slow down for adjustment, like the time of day can), but not necessarily unique: two sufficiently proximate calls may return the same value.

SunOS 5.8 Last change: 10 Apr 1997 2



Posted by eygle at 9:02 PM | Comments (0)


龙枪编年史

作者:eygle

出处:http://blog.eygle.com

作者:崔西·西克曼 马格丽特·魏丝
译者:朱学恒

首先要说明的是,此前我是极少阅读西方奇幻小说的,因为始终觉得,隔着一层文化与历史,要想真正理解一个民族的文化,实际上,具有相当的难度。

一切源于一个朋友的Mail,她说,《搜神记》极为精彩:

"建议加上《龙枪系列》为更好,一中一西,都是精彩"

这一推荐让我不得不对龙枪重新估计。以前有个同事也是龙枪的书迷,在很早的时候,他就自己编辑了整套的龙枪电子版,于是去信索取,这次他寄来的是E书时空的编辑版,全套的,他说:

"你终于想看奇幻小说了?呵呵。 按顺序读: 《龙枪编年史》-《龙枪传奇》-《龙枪传承》-《夏焰之巨龙》"

一共居然有8M多。

先读的是作者介绍:

崔西·西克曼——摩门教徒,年轻时曾远至南太平洋的西印度群岛传教。

于一九八一年进入纸上角色扮演游戏设计公司TSR任职,担任游戏企划的工作,目前为全职自由作家,从事小说撰写及纸上角色扮演游戏的设计。

马格丽特。魏丝——毕业于密苏里州立大学,主修创作与文学,于TSR担任出版部门的编辑,《龙枪编年史》即为此期间与崔西共同创作出的作品。目前为自由作家,与夫婿共同撰写奇幻及科幻类型的小说。

两人合作的畅销作品:《龙枪编年史》、《龙枪传奇三部曲》、《龙枪传承》、《夏焰之巨龙》、《暗黑之剑三部曲》、《死亡之门系列》等。

看来这一对也是让人艳羡的超级组合吧。

慢慢的读,也和大家分享:

龙枪编年史 龙枪传奇 神器系列 伊斯塔的统治

感谢我的两位朋友:)

-The End-

Posted by eygle at 3:03 PM | Comments (2)



CopyRight © 2004-2008 eygle.com, All rights reserved.