當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Clock類代碼示例

本文整理匯總了C#中System.Clock的典型用法代碼示例。如果您正苦於以下問題:C# Clock類的具體用法?C# Clock怎麽用?C# Clock使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Clock類屬於System命名空間,在下文中一共展示了Clock類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Main

 static void Main(string[] args)
 {
     IClock myclock = new Clock();
     var todaySalutation = new TodaySalutation(myclock);
     Console.WriteLine(todaySalutation.Salutation());
     Console.ReadKey();
 }
開發者ID:atulpatel,項目名稱:UnitTestTraining,代碼行數:7,代碼來源:Program.cs

示例2: NormalSurface

        internal NormalRunoff runoff; //let derived PondSurface see this but not outside world.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="NormalSurface"/> class.
        /// </summary>
        /// <param name="SoilObject">The soil object.</param>
        /// <param name="Clock">The clock.</param>
        public NormalSurface(SoilWaterSoil SoilObject, Clock Clock)
        {
            SurfaceType = Surfaces.NormalSurface;
            base.constants = SoilObject.Constants;
            runoff = new NormalRunoff(SoilObject);     //Soil is needed to initialise the cn2bare, etc.
            evap = new NormalEvaporation(SoilObject, Clock);
        }
開發者ID:hol353,項目名稱:ApsimX,代碼行數:18,代碼來源:SoilWaterSurface.cs

示例3: InvocationQueue

 public InvocationQueue(Clock clock, string instanceName, CloudBlobContainer archiveContainer, SqlConnectionStringBuilder connectionString)
     : this()
 {
     _clock = clock;
     _archiveContainer = archiveContainer;
     InstanceName = instanceName;
     _connectionString = connectionString;
 }
開發者ID:NuGet,項目名稱:NuGet.Services.Work,代碼行數:8,代碼來源:InvocationQueue.cs

示例4: PacMans

 public PacMans(Texture2D texture, Vector2 pos)
     : base(texture, pos)
 {
     this.Pos = pos;
     this.texture = texture;
     texEffects = SpriteEffects.None;
     clock = new Clock();
 }
開發者ID:LuddeW,項目名稱:Pac-Man,代碼行數:8,代碼來源:PacMans.cs

示例5: JobRunner

        public JobRunner(JobDispatcher dispatcher, InvocationQueue queue, ConfigurationHub config, Clock clock, CloudBlobContainer logContainer)
            : this(config.GetSection<WorkConfiguration>().PollInterval)
        {
            Dispatcher = dispatcher;
            Queue = queue;
            Clock = clock;

            _logContainer = logContainer;
        }
開發者ID:NuGet,項目名稱:NuGet.Services.Work,代碼行數:9,代碼來源:JobRunner.cs

示例6: CanCreateClock

        public void CanCreateClock()
        {
            var expected = 27;
            var clock = new Clock(expected);

            Assert.AreEqual(expected, clock.Queue.Count());
            Assert.AreEqual(1, clock.Queue.First());
            Assert.AreEqual(27, clock.Queue.Last());
        }
開發者ID:c0de,項目名稱:BallClock,代碼行數:9,代碼來源:ClockTests.cs

示例7: Run_All

 /// <summary>
 /// Runs all tests 27-127
 /// </summary>
 //[TestCase]
 public void Run_All()
 {
     for (int i = 27; i <= 127; i++)
     {
         var clock = new Clock(i);
         var result = clock.Start();
         Assert.IsTrue(result.StartsWith(i.ToString()));
     }
 }
開發者ID:c0de,項目名稱:BallClock,代碼行數:13,代碼來源:ClockTests.cs

示例8: ClockView

        public ClockView(IntPtr handle)
            : base(handle)
        {
            _clock = new Clock ();

            _timer = NSTimer.CreateRepeatingScheduledTimer (1, delegate {
                SetNeedsDisplayInRect (Bounds);
            });
        }
開發者ID:nissan,項目名稱:CrossGraphics,代碼行數:9,代碼來源:ClockView.cs

示例9: Pengo

 public Pengo(Texture2D texture, Vector2 pos)
     : base(texture, pos)
 {
     clock = new Clock();
     speed = new Vector2(1, 1);
     windowY = Game1.TILE_SIZE * 15;
     hitbox = new Rectangle((int)pos.X, (int)pos.Y, Game1.TILE_SIZE, Game1.TILE_SIZE);
     texData = new Color[texture.Width * texture.Height];
     texture.GetData(texData);
 }
開發者ID:LuddeW,項目名稱:SuperPengoMan-official-,代碼行數:10,代碼來源:Pengo.cs

示例10: PhiAccrualFailureDetector

 /// <summary>
 /// Procedural constructor for PhiAccrualDetector
 /// </summary>
 /// <param name="threshold">A low threshold is prone to generate many wrong suspicions but ensures a quick detection in the event
 /// of a real crash. Conversely, a high threshold generates fewer mistakes but needs more time to detect actual crashes</param>
 /// <param name="maxSampleSize">Number of samples to use for calculation of mean and standard deviation of inter-arrival times.</param>
 /// <param name="minStdDeviation">Minimum standard deviation to use for the normal distribution used when calculating phi.
 /// Too low standard deviation might result in too much sensitivity for sudden, but normal, deviations 
 /// in heartbeat inter arrival times.</param>
 /// <param name="acceptableHeartbeatPause">Duration corresponding to number of potentially lost/delayed
 /// heartbeats that will be accepted before considering it to be an anomaly.
 /// This margin is important to be able to survive sudden, occasional, pauses in heartbeat
 /// arrivals, due to for example garbage collect or network drop.</param>
 /// <param name="firstHeartbeatEstimate">Bootstrap the stats with heartbeats that corresponds to
 /// to this duration, with a with rather high standard deviation (since environment is unknown
 /// in the beginning)</param>
 /// <param name="clock">The clock, returning current time in milliseconds, but can be faked for testing
 /// purposes. It is only used for measuring intervals (duration).</param>
 public PhiAccrualFailureDetector(double threshold, int maxSampleSize, TimeSpan minStdDeviation, TimeSpan acceptableHeartbeatPause, TimeSpan firstHeartbeatEstimate, Clock clock = null)
     : this(clock)
 {
     _threshold = threshold;
     _maxSampleSize = maxSampleSize;
     _minStdDeviation = minStdDeviation;
     _acceptableHeartbeatPause = acceptableHeartbeatPause;
     _firstHeartbeatEstimate = firstHeartbeatEstimate;
     state = new State(FirstHeartBeat, null);
 }
開發者ID:Micha-kun,項目名稱:akka.net,代碼行數:28,代碼來源:PhiAccrualFailureDetector.cs

示例11: NormalEvaporation

        //Constructor
        public NormalEvaporation(SoilWaterSoil SoilObject, Clock Clock)
        {
            cons = SoilObject.Constants;

            salb = SoilObject.Salb;

            summerCona = SoilObject.SummerCona;
            summerU = SoilObject.SummerU;
            summerDate = SoilObject.SummerDate;

            winterCona = SoilObject.WinterCona;
            winterU = SoilObject.WinterU;
            winterDate = SoilObject.WinterDate;

            // soilwat2_soil_property_param()

            //u - can either use (one value for summer and winter) or two different values.
            //    (must also take into consideration where they enter two values [one for summer and one for winter] but they make them both the same)

            if ((Double.IsNaN(summerU) || (Double.IsNaN(winterU))))
                {
                throw new Exception("A single value for u OR BOTH values for summeru and winteru must be specified");
                }
            //if they entered two values but they made them the same
            if (summerU == winterU)
                {
                u = summerU;      //u is now no longer null. As if the user had entered a value for u.
                }

            //cona - can either use (one value for summer and winter) or two different values.
            //       (must also take into consideration where they enter two values [one for summer and one for winter] but they make them both the same)

            if ((Double.IsNaN(summerCona)) || (Double.IsNaN(winterCona)))
                {
                throw new Exception("A single value for cona OR BOTH values for summercona and wintercona must be specified");
                }
            //if they entered two values but they made them the same.
            if (summerCona == winterCona)
                {
                cona = summerCona;   //cona is now no longer null. As if the user had entered a value for cona.
                }

            //summer and winter default dates.
            if (summerDate == "not_read")
                {
                summerDate = "1-oct";
                }

            if (winterDate == "not_read")
                {
                winterDate = "1-apr";
                }

            InitialiseAccumulatingVars(SoilObject, Clock);
        }
開發者ID:hol353,項目名稱:ApsimX,代碼行數:56,代碼來源:SoilWaterEvap.cs

示例12: MainForm

        public MainForm()
        {
            InitializeComponent();

            _clock = new Clock();

            _trackerBrowser = new EyetrackerBrowser();
            _trackerBrowser.EyetrackerFound += EyetrackerFound;
            _trackerBrowser.EyetrackerUpdated += EyetrackerUpdated;
            _trackerBrowser.EyetrackerRemoved += EyetrackerRemoved;
        }
開發者ID:Faham,項目名稱:emophiz,代碼行數:11,代碼來源:MainForm.cs

示例13: MainWindow

 public MainWindow()
 {
     // Initialize Tobii SDK eyetracking library
     Library.Init();
     InitializeComponent();
     clock = new Clock();
     trackerBrowser = new EyetrackerBrowser();
     trackerBrowser.EyetrackerFound += EyetrackerFound;
     trackerBrowser.EyetrackerUpdated += EyetrackerUpdated;
     trackerBrowser.EyetrackerRemoved += EyetrackerRemoved;
 }
開發者ID:yong-ja,項目名稱:starodyssey,代碼行數:11,代碼來源:MainWindow.xaml.cs

示例14: TrackerWrapper

 public TrackerWrapper()
 {
     // Initialize Tobii SDK eyetracking library
     Library.Init();
     clock = new Clock();
     trackerBrowser = new EyetrackerBrowser();
     trackerBrowser.EyetrackerFound += EyetrackerFound;
     trackerBrowser.EyetrackerUpdated += EyetrackerUpdated;
     trackerBrowser.EyetrackerRemoved += EyetrackerRemoved;
     smoother = new AverageWindow(10);
 }
開發者ID:yong-ja,項目名稱:starodyssey,代碼行數:11,代碼來源:TrackerWrapper.cs

示例15: Run

        public void Run(Clock clock, IMarginalEmissionState state, IDimensions dimensions)
        {
            var t = clock.Current;
            var s = state;

            if ((t.Value >= s.emissionperiod.Value) && (t.Value < (s.emissionperiod.Value + s.impulselength)))
            {
                s.modemission[t] = s.emission[t] + 1;
            }
            else
                s.modemission[t] = s.emission[t];
        }
開發者ID:fund-model,項目名稱:fund,代碼行數:12,代碼來源:MarginalEmissionComponent.cs


注:本文中的System.Clock類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。