Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > C++0X Its about...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 12 Topic 9487 of 9983
Post > Topic >>

C++0X Its about (y)time

by "Terry G" <tjgolubi@[EMAIL PROTECTED] > Apr 10, 2008 at 07:43 PM

This is the proposed ytime.

struct ytime { time_t tv_sec; unsigned long tv_nsec; };

This time representation would be used for both absolute and relative
time,
i.e. all time delays and would be returned by all standard-conforming
clocks.

This time representation would be used as an argument for sleep() and for
condition_variable::timed_wait().

Some points in favor of ytime:

     * simple

     * easy to monitor in a debugger

..  * maps easily to POSIX timespec and (deprecated) time_t

    * same time representation for absolute and relative time

Some points agains ytime

   * operations on ytime are difficult and error-prone because the time is
broken up into two fields instead of being a continuous count

   * operations and storage are less efficient than just a 'long long
count'
of nanoseconds since midnight, Jan 1, 1970 (overflows in 2262).

   * has the same "Year 2038" problem that time_t has.

   * unclear mapping to UTC or how leap-seconds are handled

   * same time representation for absolute and relative time

This representation is very similar to POSIX timespec, so many people
already have gained experience, good or bad.

More elaborate systems of clocks and time representations are possible,
but
please limit discussion to the ytime representation.

Do you think C++ should adopt ytime?

terry





-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 12 Posts in Topic:
C++0X Its about (y)time
"Terry G" <t  2008-04-10 19:43:54 
Re: C++0X Its about (y)time
Francis Glassborow <fr  2008-04-11 11:45:56 
Re: C++0X Its about (y)time
Alberto Ganesh Barbati &l  2008-04-13 00:43:08 
Re: C++0X Its about (y)time
=?ISO-8859-1?Q?Pedro_Lama  2008-04-13 00:43:12 
Re: C++0X Its about (y)time
Francis Glassborow <fr  2008-04-13 12:48:05 
Re: C++0X Its about (y)time
Pete Becker <pete@[EMA  2008-04-13 12:48:04 
Re: C++0X Its about (y)time
marlow.andrew@[EMAIL PROT  2008-04-13 12:45:58 
Re: C++0X Its about (y)time
Alberto Ganesh Barbati &l  2008-04-13 18:20:47 
Re: C++0X Its about (y)time
Anthony Williams <anth  2008-04-14 10:32:45 
Re: C++0X Its about (y)time
Francis Glassborow <fr  2008-04-14 12:41:18 
Re: C++0X Its about (y)time
Alberto Ganesh Barbati &l  2008-04-14 21:22:33 
Re: C++0X Its about (y)time
Howard Hinnant <howard  2008-04-16 11:39:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 3:30:21 CDT 2008.