示例#1
0
        public void Test_timeIsIncreasing()
        {
            var prevDateTime = DateTimeRange.ConvertFromUnixTimestamp(0);

            for (int n = 0; n < 40; n++)
            {
                Console.WriteLine("Iter");
                _fakedMillisecond++;
                if (_fakedMillisecond >= 1000)
                {
                    _fakedSecond++;
                    _fakedMillisecond = _fakedMillisecond % 1000;
                }

                ScePspDateTime scePspDateTime;
                SceRtc.sceRtcGetCurrentClock(out scePspDateTime, 0);

                var currentDateTime = scePspDateTime.ToDateTime();

                if (!(currentDateTime > prevDateTime))
                {
                    Console.WriteLine("N: {0}", n);
                    Console.WriteLine("P: {0}", prevDateTime.Ticks);
                    Console.WriteLine("C: {0}", currentDateTime.Ticks);
                }
                Assert.True(currentDateTime.Ticks > prevDateTime.Ticks);
                prevDateTime = currentDateTime;
            }
        }
示例#2
0
 public int sceRtcSetTime_t(out ScePspDateTime date, uint time)
 {
     date = ScePspDateTime.FromDateTime(DateTimeRange.ConvertFromUnixTimestamp(time));
     return(0);
 }