Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2983

Show
Ignore:
Timestamp:
12/08/07 15:08:57 (1 year ago)
Author:
kris
Message:

* shortened a couple of overly long names (in new package)
* gave TimeOfDay? methods the same names as TimeSpan? ones

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/networking/selector.d

    r2978 r2983  
    294294                    failedConnectCount, failedReceiveCount, failedSendCount, errorCount)); 
    295295 
    296     log.info(sprint("Total time: {0} ms", cast(uint) (Clock.now - start).milliseconds)); 
     296    log.info(sprint("Total time: {0} ms", cast(uint) (Clock.now - start).millis)); 
    297297 
    298298    clientThread.join(); 
  • trunk/tango/io/FilePath.d

    r2978 r2983  
    11021102                        static Time convert (FILETIME time) 
    11031103                        { 
    1104                                 return Time.epoch1601 + TimeSpan(*cast(long*) &time); 
     1104                                return Time (TimeSpan.Epoch1601 + *cast(long*) &time); 
    11051105                        } 
    11061106 
     
    14211421                        { 
    14221422                                return Time.epoch1970 + 
    1423                                     TimeSpan.seconds(tv.tv_sec) + 
    1424                                     TimeSpan.microseconds(tv.tv_usec); 
     1423                                       TimeSpan.seconds(tv.tv_sec) + 
     1424                                       TimeSpan.microseconds(tv.tv_usec); 
    14251425                        } 
    14261426 
  • trunk/tango/io/selector/AbstractSelector.d

    r2903 r2983  
    336336    { 
    337337        tv.tv_sec = cast(typeof(tv.tv_sec)) interval.seconds; 
    338         tv.tv_usec = cast(typeof(tv.tv_usec)) (interval.microseconds % 1_000_000); 
     338        tv.tv_usec = cast(typeof(tv.tv_usec)) (interval.micros % 1_000_000); 
    339339        return tv; 
    340340    } 
  • trunk/tango/io/selector/EpollSelector.d

    r2900 r2983  
    358358        public int select(TimeSpan timeout) 
    359359        { 
    360             int to = (timeout != TimeSpan.max ? cast(int) timeout.milliseconds : -1); 
     360            int to = (timeout != TimeSpan.max ? cast(int) timeout.millis : -1); 
    361361 
    362362            while (true) 
  • trunk/tango/io/selector/PollSelector.d

    r2913 r2983  
    311311        public int select(TimeSpan timeout) 
    312312        { 
    313             int to = (timeout != TimeSpan.max ? cast(int) timeout.milliseconds : -1); 
     313            int to = (timeout != TimeSpan.max ? cast(int) timeout.millis : -1); 
    314314 
    315315            debug (selector) 
  • trunk/tango/io/selector/SelectSelector.d

    r2900 r2983  
    437437 
    438438        debug (selector) 
    439             Stdout.format("--- SelectSelector.select(timeout={0} msec)\n", timeout.milliseconds); 
     439            Stdout.format("--- SelectSelector.select(timeout={0} msec)\n", timeout.millis); 
    440440 
    441441        if (_readSet !is null) 
  • trunk/tango/net/Socket.d

    r2978 r2983  
    14011401                timeval tv; 
    14021402                tv.tv_sec = cast(uint) time.seconds; 
    1403                 tv.tv_usec = cast(uint) time.microseconds % 1_000_000; 
     1403                tv.tv_usec = cast(uint) time.micros % 1_000_000; 
    14041404                return tv; 
    14051405        } 
  • trunk/tango/net/cluster/QueuedCache.d

    r2978 r2983  
    288288                QueuedEntry*    prev, 
    289289                                next; 
    290                 Time        time; 
     290                Time            time; 
    291291                V               value; 
    292292 
  • trunk/tango/net/cluster/tina/Cluster.d

    r2978 r2983  
    10551055 
    10561056                            // set a 500ms timeout for read operations 
    1057                             conduit_.setTimeout (TimeSpan.milliseconds(500)); 
     1057                            conduit_.setTimeout (TimeSpan.millis(500)); 
    10581058 
    10591059                            // open a connection to this server 
  • trunk/tango/net/ftp/Telnet.d

    r2978 r2983  
    3636 
    3737        /// The number of milliseconds to wait for socket communication or connection. 
    38         protected TimeSpan timeout = TimeSpan.milliseconds(5000); 
     38        protected TimeSpan timeout = TimeSpan.millis(5000); 
    3939 
    4040        /// provided by host 
     
    239239                   { 
    240240                   char[10] tmp; 
    241                    exception ("CLIENT: Unable to connect within the specified time limit (" ~ Integer.itoa(tmp, cast(uint) this.timeout.milliseconds) ~ " ms.)"); 
     241                   exception ("CLIENT: Unable to connect within the specified time limit (" ~ Integer.itoa(tmp, cast(uint) this.timeout.millis) ~ " ms.)"); 
    242242                   } 
    243243 
  • trunk/tango/text/locale/Convert.d

    r2980 r2983  
    367367                             case 'h':  // hour (12-hour clock) 
    368368                                  len = parseRepeat(format, index, c); 
    369                                   int hour = time.hour % 12; 
     369                                  int hour = time.hours % 12; 
    370370                                  if (hour is 0) 
    371371                                      hour = 12; 
     
    374374                             case 'H':  // hour (24-hour clock) 
    375375                                  len = parseRepeat(format, index, c); 
    376                                   result ~= formatInt (tmp, time.hour, len); 
     376                                  result ~= formatInt (tmp, time.hours, len); 
    377377                                  break; 
    378378                             case 'm':  // minute 
    379379                                  len = parseRepeat(format, index, c); 
    380                                   result ~= formatInt (tmp, time.minute, len); 
     380                                  result ~= formatInt (tmp, time.minutes, len); 
    381381                                  break; 
    382382                             case 's':  // second 
    383383                                  len = parseRepeat(format, index, c); 
    384                                   result ~= formatInt (tmp, time.second, len); 
     384                                  result ~= formatInt (tmp, time.seconds, len); 
    385385                                  break; 
    386386                             case 't':  // AM/PM 
     
    388388                                  if (len is 1) 
    389389                                     { 
    390                                      if (time.hour < 12) 
     390                                     if (time.hours < 12) 
    391391                                        { 
    392392                                        if (dtf.amDesignator.length != 0) 
     
    400400                                     } 
    401401                                  else 
    402                                      result ~= (time.hour < 12) ? dtf.amDesignator : dtf.pmDesignator; 
     402                                     result ~= (time.hours < 12) ? dtf.amDesignator : dtf.pmDesignator; 
    403403                                  break; 
    404404                             case 'z':  // timezone offset 
  • trunk/tango/text/locale/Parse.d

    r2978 r2983  
    133133      //Due to dmd bug, this doesn't compile 
    134134      //TimeSpan result = TimeSpan.hours(hour) +  TimeSpan.minutes(minute); 
    135       TimeSpan result = TimeSpan(TimeSpan.hour.ticks * hour +  TimeSpan.minute.ticks * minute); 
     135      TimeSpan result = TimeSpan(TimeSpan.TicksPerHour * hour +  TimeSpan.TicksPerMinute * minute); 
    136136      if (sign) 
    137137        result = -result; 
  • trunk/tango/time/Clock.d

    r2978 r2983  
    133133                package static Time convert (FILETIME time) 
    134134                { 
    135                         auto t = *cast(long*)&time; 
     135                        auto t = *cast(long*) &time; 
    136136                        t *= 100 / TimeSpan.NanosecondsPerTick; 
    137137                        return Time.epoch1601 + TimeSpan(t); 
     
    241241                        return Time.epoch1970 +  
    242242                               TimeSpan.seconds(seconds) +  
    243                                TimeSpan.milliseconds(date.ms); 
     243                               TimeSpan.millis(date.ms); 
    244244                } 
    245245 
     
    254254                        return Time.epoch1970 +  
    255255                               TimeSpan.seconds(tv.tv_sec) +  
    256                                TimeSpan.microseconds(tv.tv_usec); 
     256                               TimeSpan.micros(tv.tv_usec); 
    257257                } 
    258258 
     
    270270                        assert (span >= TimeSpan.zero); 
    271271                        tv.tv_sec  = span.seconds; 
    272                         tv.tv_usec = span.microseconds % 1_000_000L; 
     272                        tv.tv_usec = span.micros % 1_000_000L; 
    273273                        return tv; 
    274274                } 
  • trunk/tango/time/Time.d

    r2980 r2983  
    4141        private long ticks_; 
    4242 
     43        private enum : long 
     44        { 
     45                maximum  = (TimeSpan.DaysPer400Years * 25 - 366) * TimeSpan.TicksPerDay - 1, 
     46                minimum  = -((TimeSpan.DaysPer400Years * 25 - 366) * TimeSpan.TicksPerDay - 1), 
     47        } 
     48 
    4349        /// Represents the smallest and largest Time value. 
    44         public static const Time epoch = {0}, 
    45                                  max   = {(TimeSpan.DaysPer400Years * 25 - 366) * TimeSpan.TicksPerDay - 1}, 
    46                                  min   = {-((TimeSpan.DaysPer400Years * 25 - 366) * TimeSpan.TicksPerDay - 1)}, 
    47                                  epoch1601 = {TimeSpan.DaysPer400Years * 4 * TimeSpan.TicksPerDay}, 
    48                                  epoch1970 = {TimeSpan.DaysPer400Years * 4 * TimeSpan.TicksPerDay + TimeSpan.TicksPerSecond * 11644473600L}; 
     50        static const Time epoch    = {0}, 
     51                          min       = {minimum}, 
     52                          max       = {maximum}, 
     53                          epoch1601 = {TimeSpan.Epoch1601}, 
     54                          epoch1970 = {TimeSpan.Epoch1970}; 
    4955 
    5056        /********************************************************************** 
     
    8692                if (ticks_ < t.ticks_) 
    8793                    return -1; 
     94 
    8895                if (ticks_ > t.ticks_) 
    8996                    return 1; 
     97 
    9098                return 0; 
    9199        } 
     
    183191        Time date ()  
    184192        { 
    185                 return Time (ticks_ - (ticks_ % TimeSpan.day.ticks)); 
    186         } 
    187  
    188         /********************************************************************** 
    189  
    190                 $(I Property.) Retrieves the equivalent TimeSpan. 
    191  
    192                 Returns: A TimeSpan representing this Time. 
    193  
    194         **********************************************************************/ 
    195  
    196         TimeSpan span ()  
    197         { 
    198                 return TimeSpan (ticks_); 
     193                return Time (ticks_ - (ticks_ % TimeSpan.TicksPerDay)); 
    199194        } 
    200195 
     
    211206        { 
    212207                return TimeOfDay (ticks_); 
     208        } 
     209 
     210        /********************************************************************** 
     211 
     212                $(I Property.) Retrieves the equivalent TimeSpan. 
     213 
     214                Returns: A TimeSpan representing this Time. 
     215 
     216        **********************************************************************/ 
     217 
     218        TimeSpan span ()  
     219        { 
     220                return TimeSpan (ticks_); 
    213221        } 
    214222} 
     
    235243        { 
    236244                auto c = foo(); 
    237                 auto h = c.time.minute
     245                auto h = c.time.minutes
    238246                Stdout (c.ticks).newline; 
    239247        } 
  • trunk/tango/time/TimeSpan.d

    r2980 r2983  
    2727 * 
    2828 * Time start = Clock.now; 
    29  * Thread.sleep(TimeSpan.milliseconds(150).interval); 
     29 * Thread.sleep(TimeSpan.millis(150).interval); 
    3030 * Stdout.format("slept for {} ms", 
    31  *    (start - Clock.now).milliseconds).newline; 
     31 *    (start - Clock.now).millis).newline; 
    3232 * ------------------- 
    3333 * See_Also: tango.core.Thread, tango.time.Time, tango.time.Clock 
     
    4444        enum : long  
    4545        { 
     46                /// basic tick values 
    4647                NanosecondsPerTick  = 100, 
    4748                TicksPerMicrosecond = 1000 / NanosecondsPerTick, 
     
    5253                TicksPerDay         = 24 * TicksPerHour, 
    5354 
     55                // millisecond counts 
    5456                MillisPerSecond     = 1000, 
    5557                MillisPerMinute     = MillisPerSecond * 60, 
     
    5759                MillisPerDay        = MillisPerHour * 24, 
    5860 
     61                /// day counts 
    5962                DaysPerYear         = 365, 
    6063                DaysPer4Years       = DaysPerYear * 4 + 1, 
    6164                DaysPer100Years     = DaysPer4Years * 25 - 1, 
    6265                DaysPer400Years     = DaysPer100Years * 4 + 1, 
     66 
     67                // epoch counts 
     68                Epoch1601           = DaysPer400Years * 4 * TicksPerDay, 
     69                Epoch1970           = Epoch1601 + TicksPerSecond * 11644473600L, 
     70        } 
     71/+ 
     72        enum Tick : long  
     73        { 
     74                Micro  = TicksPerMicrosecond,      
     75                Milli  = TicksPerMillisecond, 
     76                Second = TicksPerSecond, 
     77                Minute = TicksPerMinute, 
     78                Hour   = TicksPerHour, 
     79                Day    = TicksPerDay 
     80        } 
     81 
     82        enum Milli : long  
     83        { 
     84                Second = 1000, 
     85                Minute = Second * 60, 
     86                Hour   = Minute * 60, 
     87                Day    = Hour * 24 
     88        } 
     89 
     90        enum Day : long  
     91        { 
     92                Year    = 365, 
     93                Year4   = Year * 4 + 1, 
     94                Year100 = Year4 * 25 - 1, 
     95                Year400 = Year100 * 4 + 1 
    6396        } 
    6497 
     
    67100         * measurement of the same name. 
    68101         */ 
     102 
     103        // NOTE: const is not manifest-constant, so the use of these makes 
     104        // for less efficient codegen. I've removed them for now 
    69105        static const TimeSpan microsecond = {TicksPerMicrosecond}, 
    70106                              millisecond = {TicksPerMillisecond}, 
     
    73109                              hour        = {TicksPerHour}, 
    74110                              day         = {TicksPerDay}; 
    75  
    76         /** 
    77          * Alias for microsecond 
    78          */ 
    79         alias microsecond us; 
    80  
    81         /** 
    82          * Alias for millisecond 
    83          */ 
    84         alias millisecond ms; 
    85111 
    86112        // 
     
    93119                              fourHundredYears = {DaysPer400Years * TicksPerDay}; 
    94120 
     121+/ 
     122 
    95123        /** 
    96124         * Minimum TimeSpan 
    97125         */ 
    98         static const TimeSpan min = {long.min}; 
     126        static const TimeSpan min = {long.min}; 
    99127 
    100128        /** 
    101129         * Maximum TimeSpan 
    102130         */ 
    103         static const TimeSpan max = {long.max}; 
     131        static const TimeSpan max = {long.max}; 
    104132 
    105133        /** 
     
    131159                if (ticks_ < t.ticks_) 
    132160                    return -1; 
     161 
    133162                if (ticks_ > t.ticks_) 
    134163                    return 1; 
     164 
    135165                return 0; 
    136166        } 
     
    271301         * Returns: The number of nanoseconds that this TimeSpan represents. 
    272302         */ 
    273         long nanoseconds() 
     303        long nanos() 
    274304        { 
    275305                return ticks_ * NanosecondsPerTick; 
     
    281311         * Returns: The number of microseconds that this TimeSpan represents. 
    282312         */ 
    283         long microseconds() 
     313        long micros() 
    284314        { 
    285315                return ticks_ / TicksPerMicrosecond; 
     
    291321         * Returns: The number of milliseconds that this TimeSpan represents. 
    292322         */ 
    293         long milliseconds() 
     323        long millis() 
    294324        { 
    295325                return ticks_ / TicksPerMillisecond; 
     
    323353        long hours() 
    324354        { 
    325                 return ticks_ / TicksPerHour; 
     355                return ticks_ / TicksPerHour; 
    326356        } 
    327357 
     
    333363        long days() 
    334364        { 
    335                 return ticks_ / TicksPerDay; 
     365                return ticks_ / TicksPerDay; 
    336366        } 
    337367 
     
    347377        double interval() 
    348378        { 
    349                 return (cast(double)ticks_) / TicksPerSecond; 
     379                return (cast(double) ticks_) / TicksPerSecond; 
    350380        } 
    351381 
     
    369399         * Returns: A TimeSpan representing the given number of nanoseconds. 
    370400         */ 
    371         static TimeSpan nanoseconds(long value) 
     401        static TimeSpan nanos(long value) 
    372402        { 
    373403                return TimeSpan(value / NanosecondsPerTick); 
     
    380410         * Returns: A TimeSpan representing the given number of microseconds. 
    381411         */ 
    382         static TimeSpan microseconds(long value) 
     412        static TimeSpan micros(long value) 
    383413        { 
    384414                return TimeSpan(TicksPerMicrosecond * value); 
     
    391421         * Returns: A TimeSpan representing the given number of milliseconds. 
    392422         */ 
    393         static TimeSpan milliseconds(long value) 
     423        static TimeSpan millis(long value) 
    394424        { 
    395425                return TimeSpan(TicksPerMillisecond * value); 
     
    466496        private long ticks; 
    467497 
    468         /** 
    469          * Alias for microsecond 
    470          */ 
    471         alias microsecond us; 
    472         /** 
    473          * Alias for millisecond 
    474          */ 
    475         alias millisecond ms; 
    476  
    477498        /********************************************************************** 
    478499 
    479                 $(I Property.) Retrieves the _hour component of the date. 
     500                $(I Property.) Retrieves the _hour component of the time. 
    480501 
    481502                Returns: The _hour. 
     
    483504        **********************************************************************/ 
    484505 
    485         int hour ()  
     506        int hours ()  
    486507        { 
    487508                return cast(int) ((ticks / TimeSpan.TicksPerHour) % 24); 
     
    490511        /********************************************************************** 
    491512 
    492                 $(I Property.) Retrieves the _minute component of the date. 
     513                $(I Property.) Retrieves the _minute component of the time. 
    493514 
    494515                Returns: The _minute. 
     
    496517        **********************************************************************/ 
    497518 
    498         int minute ()  
     519        int minutes ()  
    499520        { 
    500521                return cast(int) ((ticks / TimeSpan.TicksPerMinute) % 60); 
     
    503524        /********************************************************************** 
    504525 
    505                 $(I Property.) Retrieves the _second component of the date. 
     526                $(I Property.) Retrieves the _second component of the time. 
    506527 
    507528                Returns: The _second. 
     
    509530        **********************************************************************/ 
    510531 
    511         int second ()  
     532        int seconds ()  
    512533        { 
    513534                return cast(int) ((ticks / TimeSpan.TicksPerSecond) % 60); 
     
    517538 
    518539                $(I Property.) Retrieves the _millisecond component of the  
    519                 date. 
    520  
    521                 Returns: The _millisecond
     540                time. 
     541 
     542                Returns: The _milliseconds
    522543 
    523544        **********************************************************************/ 
    524545 
    525         int millisecond ()  
     546        int millis ()  
    526547        { 
    527548                return cast(int) ((ticks / TimeSpan.TicksPerMillisecond) % 1000); 
     
    531552 
    532553                $(I Property.) Retrieves the _microsecond component of the  
    533                 date. 
    534  
    535                 Returns: The _microsecond
     554                time. 
     555 
     556                Returns: The _microseconds
    536557 
    537558        **********************************************************************/ 
    538559 
    539         int microsecond ()  
     560        int micros ()  
    540561        { 
    541562                return cast(int) ((ticks / TimeSpan.TicksPerMicrosecond) % 1000); 
     
    544565 
    545566 
    546  
    547 unittest 
     567debug (UnitTest) 
    548568{ 
    549         assert(TimeSpan.ms > TimeSpan.us); 
    550         assert(TimeSpan.year > TimeSpan.us); 
    551         assert(TimeSpan.year > TimeSpan.day); 
    552         assert(TimeSpan.zero > TimeSpan.min); 
    553         assert(TimeSpan.max  > TimeSpan.zero); 
    554         assert(TimeSpan.max  > TimeSpan.min); 
    555         assert(TimeSpan.zero >= TimeSpan.zero); 
    556         assert(TimeSpan.zero <= TimeSpan.zero); 
    557         assert(TimeSpan.max >= TimeSpan.max); 
    558         assert(TimeSpan.max <= TimeSpan.max); 
    559         assert(TimeSpan.min >= TimeSpan.min); 
    560         assert(TimeSpan.min <= TimeSpan.min); 
     569        unittest 
     570        { 
     571                assert(TimeSpan.zero > TimeSpan.min); 
     572                assert(TimeSpan.max  > TimeSpan.zero); 
     573                assert(TimeSpan.max  > TimeSpan.min); 
     574                assert(TimeSpan.zero >= TimeSpan.zero); 
     575                assert(TimeSpan.zero <= TimeSpan.zero); 
     576                assert(TimeSpan.max >= TimeSpan.max); 
     577                assert(TimeSpan.max <= TimeSpan.max); 
     578                assert(TimeSpan.min >= TimeSpan.min); 
     579                assert(TimeSpan.min <= TimeSpan.min); 
     580 
     581                assert (TimeSpan.micros(999).micros is 999); 
     582                assert (TimeSpan.micros(1999).micros is 1999); 
     583                assert (TimeSpan.seconds(50).seconds is 50); 
     584                assert (TimeSpan.seconds(5000).seconds is 5000); 
     585                assert (TimeSpan.minutes(50).minutes is 50); 
     586                assert (TimeSpan.minutes(5000).minutes is 5000); 
     587                assert (TimeSpan.hours(23).hours is 23); 
     588                assert (TimeSpan.hours(5000).hours is 5000); 
     589                assert (TimeSpan.days(6).days is 6); 
     590                assert (TimeSpan.days(5000).days is 5000); 
     591 
     592                assert (TimeSpan.micros(999).time.micros is 999); 
     593                assert (TimeSpan.micros(1999).time.micros is 999); 
     594                assert (TimeSpan.seconds(50).time.seconds is 50); 
     595                assert (TimeSpan.seconds(5000).time.seconds is 5000 % 60); 
     596                assert (TimeSpan.minutes(50).time.minutes is 50); 
     597                assert (TimeSpan.minutes(5000).time.minutes is 5000 % 60); 
     598                assert (TimeSpan.hours(23).time.hours is 23); 
     599                assert (TimeSpan.hours(5000).time.hours is 5000 % 24); 
     600        } 
    561601} 
    562602 
     
    567607        { 
    568608                auto t = TimeSpan(1); 
    569                 auto h = t.hour
    570                 auto m = t.time.minute
     609                auto h = t.hours
     610                auto m = t.time.minutes
    571611        } 
    572612} 
  • trunk/tango/time/WallClock.d

    r2978 r2983  
    231231 
    232232                        auto seconds = mktime (&t); 
    233                         return Time.epoch1970 + TimeSpan.seconds(seconds) + TimeSpan.milliseconds(date.ms); 
     233                        return Time.epoch1970 + TimeSpan.seconds(seconds)  
     234                                              + TimeSpan.millis(date.ms); 
    234235                } 
    235236        } 
     
    241242        static Time toLocal (Time utc) 
    242243        { 
    243                 auto mod = utc.ticks % TimeSpan.ms.ticks
     244                auto mod = utc.ticks % TimeSpan.TicksPerMillisecond
    244245                return Clock.fromDate(toDate(utc)) + TimeSpan(mod); 
    245246        } 
     
    251252        static Time toUtc (Time wall) 
    252253        { 
    253                 auto mod = wall.ticks % TimeSpan.ms.ticks
     254                auto mod = wall.ticks % TimeSpan.TicksPerMillisecond
    254255                return fromDate(Clock.toDate(wall)) + TimeSpan(mod); 
    255256        } 
  • trunk/tango/time/chrono/Gregorian.d

    r2978 r2983  
    7272        override Time getTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) 
    7373        { 
    74                 return Time (getDateTicks(year, month, day) + getTimeTicks(hour, minute, second)) + TimeSpan.milliseconds(millisecond); 
     74                return Time (getDateTicks(year, month, day) + getTimeTicks(hour, minute, second)) + TimeSpan.millis(millisecond); 
    7575        } 
    7676 
     
    8282        override DayOfWeek getDayOfWeek(Time time)  
    8383        { 
    84                 return cast(DayOfWeek)((time.ticks / TimeSpan.day.ticks + 1) % 7); 
     84                return cast(DayOfWeek)((time.ticks / TimeSpan.TicksPerDay + 1) % 7); 
    8585        } 
    8686 
     
    228228        package static void splitDate (long ticks, out int year, out int month, out int day, out int dayOfYear)  
    229229        { 
    230                 int numDays = cast(int)(ticks / TimeSpan.day.ticks); 
     230                int numDays = cast(int)(ticks / TimeSpan.TicksPerDay); 
    231231                int whole400Years = numDays / cast(int) TimeSpan.DaysPer400Years; 
    232232                numDays -= whole400Years * cast(int) TimeSpan.DaysPer400Years; 
     
    276276                int[] monthDays = isLeapYear(year, AD_ERA) ? DaysToMonthLeap : DaysToMonthCommon; 
    277277                year--; 
    278                 return (year * 365 + year / 4 - year / 100 + year / 400 + monthDays[month - 1] + day - 1) * TimeSpan.day.ticks
     278                return (year * 365 + year / 4 - year / 100 + year / 400 + monthDays[month - 1] + day - 1) * TimeSpan.TicksPerDay
    279279        } 
    280280} 
  • trunk/tango/time/chrono/Hebrew.d

    r2978 r2983  
    7979   */ 
    8080  public override DayOfWeek getDayOfWeek(Time time) { 
    81     return cast(DayOfWeek) cast(int) ((time.ticks / TimeSpan.day.ticks + 1) % 7); 
     81    return cast(DayOfWeek) cast(int) ((time.ticks / TimeSpan.TicksPerDay + 1) % 7); 
    8282  } 
    8383 
     
    9191    int yearType = getYearType(year); 
    9292    int days = getStartOfYear(year) - DaysToOneAD; 
    93     int day = cast(int)(time.ticks / TimeSpan.day.ticks) - days; 
     93    int day = cast(int)(time.ticks / TimeSpan.TicksPerDay) - days; 
    9494    int n; 
    9595    while (n < 12 && day >= MonthDays[yearType][n + 1]) { 
     
    108108    int year = getYear(time); 
    109109    int days = getStartOfYear(year) - DaysToOneAD; 
    110     return (cast(int)(time.ticks / TimeSpan.day.ticks) - days) + 1; 
     110    return (cast(int)(time.ticks / TimeSpan.TicksPerDay) - days) + 1; 
    111111  } 
    112112 
     
    120120    int yearType = getYearType(year); 
    121121    int days = getStartOfYear(year) - DaysToOneAD; 
    122     int day = cast(int)(time.ticks / TimeSpan.day.ticks) - days; 
     122    int day = cast(int)(time.ticks / TimeSpan.TicksPerDay) - days; 
    123123    int n; 
    124124    while (n < 12 && day >= MonthDays[yearType][n + 1]) { 
     
    135135   */ 
    136136  public override int getYear(Time time) { 
    137     int day = cast(int)(time.ticks / TimeSpan.day.ticks) + DaysToOneAD; 
     137    int day = cast(int)(time.ticks / TimeSpan.TicksPerDay) + DaysToOneAD; 
    138138    int low = minYear_, high = maxYear_; 
    139139    // Perform a binary search. 
     
    282282    for (int i = 1; i <= month; i++) 
    283283      days += MonthDays[yearType][i - 1]; 
    284     return Time((days * TimeSpan.day.ticks) + getTimeTicks(hour, minute, second)) + TimeSpan.milliseconds(millisecond); 
     284    return Time((days * TimeSpan.TicksPerDay) + getTimeTicks(hour, minute, second)) + TimeSpan.millis(millisecond); 
    285285  } 
    286286 
  • trunk/tango/time/chrono/Hijri.d

    r2978 r2983  
    4444   */ 
    4545  public override Time getTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { 
    46     return Time((daysSinceJan1(year, month, day) - 1) * TimeSpan.day.ticks + getTimeTicks(hour, minute, second)) + TimeSpan.milliseconds(millisecond); 
     46    return Time((daysSinceJan1(year, month, day) - 1) * TimeSpan.TicksPerDay + getTimeTicks(hour, minute, second)) + TimeSpan.millis(millisecond); 
    4747  } 
    4848 
     
    5353   */ 
    5454  public override DayOfWeek getDayOfWeek(Time time) { 
    55     return cast(DayOfWeek) (cast(int) (time.ticks / TimeSpan.day.ticks + 1) % 7); 
     55    return cast(DayOfWeek) (cast(int) (time.ticks / TimeSpan.TicksPerDay + 1) % 7); 
    5656  } 
    5757 
  • trunk/tango/util/log/Event.d

    r2978 r2983  
    153153                         
    154154                        QueryPerformanceCounter (&timerStart); 
    155                         multiplier = cast(double)TimeSpan.second.ticks / freq;        
     155                        multiplier = cast(double) TimeSpan.TicksPerSecond / freq;        
    156156                        beginTime = Clock.now; 
    157157 
  • trunk/tango/util/log/EventLayout.d

    r2978 r2983  
    6969        { 
    7070                assert (s.length > 0); 
    71                 long ms = time.milliseconds
     71                long ms = time.millis
    7272 
    7373                int len = s.length;