"Fossies" - the Fresh Open Source Software Archive

Member "gawk-5.1.0/extension/time.3am" (6 Feb 2020, 2740 Bytes) of package /linux/misc/gawk-5.1.0.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "time.3am": 5.0.1_vs_5.1.0.

    1 .TH TIME 3am "Nov 21 2019" "Free Software Foundation" "GNU Awk Extension Modules"
    2 .SH NAME
    3 time \- time functions for gawk
    4 .SH SYNOPSIS
    5 .ft CW
    6 @load "time"
    7 .sp
    8 time = gettimeofday()
    9 .br
   10 ret = sleep(amount)
   11 .ft R
   12 .SH CAUTION
   13 This extension is deprecated in favor of the
   14 .B timex
   15 extension in the
   16 .I gawkextlib
   17 project.  In the next major release of
   18 .IR gawk ,
   19 loading it will issue a warning.
   20 It will be removed from the
   21 .I gawk
   22 distribution in the major release after the next one.
   23 .SH DESCRIPTION
   24 The
   25 .I time
   26 extension adds two functions named
   27 .B gettimeofday()
   28 and
   29 .BR sleep() ,
   30 as follows.
   31 .TP
   32 .B gettimeofday()
   33 This function returns the number of seconds since the Epoch
   34 as a floating-point value. It should have subsecond precision.
   35 It returns \-1 upon error and sets
   36 .B ERRNO
   37 to indicate the problem.
   38 .TP
   39 .BI sleep( seconds )
   40 This function attempts to sleep for the given amount of seconds, which
   41 may include a fractional portion.
   42 If
   43 .I seconds
   44 is negative, or the attempt to sleep fails,
   45 then it returns \-1 and sets
   46 .BR ERRNO .
   47 Otherwise, the function should return 0 after sleeping
   48 for the indicated amount of time.
   49 .\" .SH NOTES
   50 .\" .SH BUGS
   51 .SH EXAMPLE
   52 .ft CW
   53 .nf
   54 @load "time"
   55 \&...
   56 printf "It is now %g seconds since the Epoch\en", gettimeofday()
   57 printf "Pausing for a while... " ; sleep(2.5) ; print "done"
   58 .fi
   59 .ft R
   60 .SH "SEE ALSO"
   61 .IR "GAWK: Effective AWK Programming" ,
   62 .IR filefuncs (3am),
   63 .IR fnmatch (3am),
   64 .IR fork (3am),
   65 .IR inplace (3am),
   66 .IR ordchr (3am),
   67 .IR readdir (3am),
   68 .IR readfile (3am),
   69 .IR revoutput (3am),
   70 .IR rwarray (3am).
   71 .PP
   72 .IR gettimeofday (2),
   73 .IR nanosleep (2),
   74 .IR select (2).
   75 .SH AUTHOR
   76 Arnold Robbins,
   77 .BR arnold@skeeve.com .
   78 .SH COPYING PERMISSIONS
   79 Copyright \(co 2012, 2013, 2018,
   80 Free Software Foundation, Inc.
   81 .PP
   82 Permission is granted to make and distribute verbatim copies of
   83 this manual page provided the copyright notice and this permission
   84 notice are preserved on all copies.
   85 .ig
   86 Permission is granted to process this file through troff and print the
   87 results, provided the printed document carries copying permission
   88 notice identical to this one except for the removal of this paragraph
   89 (this paragraph not being relevant to the printed manual page).
   90 ..
   91 .PP
   92 Permission is granted to copy and distribute modified versions of this
   93 manual page under the conditions for verbatim copying, provided that
   94 the entire resulting derived work is distributed under the terms of a
   95 permission notice identical to this one.
   96 .PP
   97 Permission is granted to copy and distribute translations of this
   98 manual page into another language, under the above conditions for
   99 modified versions, except that this permission notice may be stated in
  100 a translation approved by the Foundation.
  101 .\" vim: set filetype=nroff :