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

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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005