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 This extension is deprecated in favor of the timex extension in the
16 gawkextlib project. In the next major release of gawk, loading it will
17 issue a warning. It will be removed from the gawk distribution in the
18 major release after the next one.
19
21 The time extension adds two functions named gettimeofday() and sleep(),
22 as follows.
23
24 gettimeofday()
25 This function returns the number of seconds since the Epoch as a
26 floating-point value. It should have subsecond precision. It
27 returns -1 upon error and sets ERRNO to indicate the problem.
28
29 sleep(seconds)
30 This function attempts to sleep for the given amount of seconds,
31 which may include a fractional portion. If seconds is negative,
32 or the attempt to sleep fails, then it returns -1 and sets
33 ERRNO. Otherwise, the function should return 0 after sleeping
34 for the indicated amount of time.
35
37 @load "time"
38 ...
39 printf "It is now %g seconds since the Epoch\n", gettimeofday()
40 printf "Pausing for a while... " ; sleep(2.5) ; print "done"
41
43 GAWK: Effective AWK Programming, filefuncs(3am), fnmatch(3am),
44 fork(3am), inplace(3am), ordchr(3am), readdir(3am), readfile(3am),
45 revoutput(3am), rwarray(3am).
46
47 gettimeofday(2), nanosleep(2), select(2).
48
50 Arnold Robbins, arnold@skeeve.com.
51
53 Copyright © 2012, 2013, 2018, Free Software Foundation, Inc.
54
55 Permission is granted to make and distribute verbatim copies of this
56 manual page provided the copyright notice and this permission notice
57 are preserved on all copies.
58
59 Permission is granted to copy and distribute modified versions of this
60 manual page under the conditions for verbatim copying, provided that
61 the entire resulting derived work is distributed under the terms of a
62 permission notice identical to this one.
63
64 Permission is granted to copy and distribute translations of this man‐
65 ual page into another language, under the above conditions for modified
66 versions, except that this permission notice may be stated in a trans‐
67 lation approved by the Foundation.
68
69
70
71Free Software Foundation Nov 21 2019 TIME(3am)