1TIME(3am)                  GNU Awk Extension Modules                 TIME(3am)
2
3
4

NAME

6       time - time functions for gawk
7

SYNOPSIS

9       @load "time"
10
11       time = gettimeofday()
12       ret = sleep(amount)
13

DESCRIPTION

15       The time extension adds two functions named gettimeofday() and sleep(),
16       as follows.
17
18       gettimeofday()
19              This function returns the number of seconds since the Epoch as a
20              floating-point  value.  It  should have subsecond precision.  It
21              returns -1 upon error and sets ERRNO to indicate the problem.
22
23       sleep(seconds)
24              This function attempts to sleep for the given amount of seconds,
25              which may include a fractional portion.  If seconds is negative,
26              or the attempt to sleep fails,  then  it  returns  -1  and  sets
27              ERRNO.   Otherwise,  the function should return 0 after sleeping
28              for the indicated amount of time.
29

EXAMPLE

31       @load "time"
32       ...
33       printf "It is now %g seconds since the Epoch\n", gettimeofday()
34       printf "Pausing for a while... " ; sleep(2.5) ; print "done"
35

SEE ALSO

37       GAWK:  Effective   AWK   Programming,   filefuncs(3am),   fnmatch(3am),
38       fork(3am),   inplace(3am),  ordchr(3am),  readdir(3am),  readfile(3am),
39       revoutput(3am), rwarray(3am).
40
41       gettimeofday(2), nanosleep(2), select(2).
42

AUTHOR

44       Arnold Robbins, arnold@skeeve.com.
45

COPYING PERMISSIONS

47       Copyright © 2012, 2013, Free Software Foundation, Inc.
48
49       Permission is granted to make and distribute verbatim  copies  of  this
50       manual  page  provided  the copyright notice and this permission notice
51       are preserved on all copies.
52
53       Permission is granted to copy and distribute modified versions of  this
54       manual  page  under  the conditions for verbatim copying, provided that
55       the entire resulting derived work is distributed under the terms  of  a
56       permission notice identical to this one.
57
58       Permission  is granted to copy and distribute translations of this man‐
59       ual page into another language, under the above conditions for modified
60       versions,  except that this permission notice may be stated in a trans‐
61       lation approved by the Foundation.
62
63
64
65Free Software Foundation          Jan 15 2013                        TIME(3am)
Impressum