1TIME(3am) GNU Awk Extension Modules TIME(3am)
2
3
4
6 time - time functions for gawk
7
9 @load "time"
10
11 time = gettimeofday()
12 ret = sleep(amount)
13
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
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
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
44 Arnold Robbins, arnold@skeeve.com.
45
47 Copyright © 2012, 2013, 2018, 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 Feb 02 2018 TIME(3am)