DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
No more ctime(3C) errors - Time(3C++)

Approximate arithmetic operators

A new Duration can also be obtained by dividing a Duration by an integer, but the result of such division is rounded to the nearest second. The quotient of two Durations may also be taken, yielding a floating point value; this operation is useful for computing approximate ratios:

       Duration user,total;
       ...
       cout
           << "User time as a percentage of total time = "
           << (user/total)*100
           << endl;

Next topic: Conversion to and from string
Previous topic: Fixed point arithmetic operators

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004