home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!bu.edu!Shiva.COM!world!gsk
- From: gsk@world.std.com (Geoffrey S Knauth)
- Newsgroups: comp.sys.next.programmer
- Subject: Re: usleep and efficiency
- Message-ID: <Bs75rr.Ivp@world.std.com>
- Date: 30 Jul 92 10:14:14 GMT
- References: <2A778A16.26787@noiro.acs.uci.edu>
- Organization: The World Public Access UNIX, Brookline, MA
- Lines: 11
-
- In article <2A778A16.26787@noiro.acs.uci.edu> rmyers@dec5200.acs.uci.edu (Richard Myers) writes:
- >2. Is there an EASY way of finding out which way to code a line faster.
- >eg. should I say if 'fabs(x) > 2' or '(x > 2.0) || (x < -2.0)'? I'd like
- >a faster way to test this than doing a full profile run!
- >[BTW, the second way is faster].
-
- The easiest way is to remember that fabs() is a function, not a macro,
- and hence has more overhead than the second, more explicit expression.
- --
- Geoffrey S. Knauth, Marble Associates, Inc. Member BCS-NeXT, LPF
- gsk@marble.com, (617) 891-5555 work, (617) 547-5247 home Standard Disclaimers
-