本文整理汇总了C#中System.Clock类的典型用法代码示例。如果您正苦于以下问题:C# Clock类的具体用法?C# Clock怎么用?C# Clock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Clock类属于System命名空间,在下文中一共展示了Clock类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: Main
public static void Main()
{
// body chunk
Clock c = new Clock();
Console.WriteLine("Midnight " + c.GetTimeString());
c.SetTime(23, 58);
Console.WriteLine("Before midnight " + c.GetTimeString());
for (int i = 0; i < 4; i++) {
c.Tick ();
Console.WriteLine ("Tick " + c.GetTimeString());
}
}
开发者ID:kaylenehung,项目名称:introcs-csharp-examples,代码行数:12,代码来源:clock_demo.cs
示例17: SimTimeCallback
private void SimTimeCallback(Clock time)
{
if (!checkedSimTime)
{
if (Param.get("/use_sim_time", ref simTime))
{
checkedSimTime = true;
}
}
if (simTime && SimTimeEvent != null)
SimTimeEvent.Invoke(TimeSpan.FromMilliseconds(time.clock.data.sec*1000.0 + (time.clock.data.nsec/100000000.0)));
}
开发者ID:uml-robotics,项目名称:ROS.NET,代码行数:12,代码来源:Time.cs
示例18: TrackerForm
public TrackerForm()
{
Bitmaps = new List<Bitmap>();
this._trackStatus = new TrackStatusControl(1, 5, 400, Bitmaps);
InitializeComponent();
_clock = new Clock();
_trackerBrowser = new EyeTrackerBrowser();
_createImageForm = new CreateImageForm();
_createImageForm.BitmapsUpdated += BitmapsUpdated;
_trackerBrowser.EyeTrackerFound += EyetrackerFound;
_trackerBrowser.EyeTrackerUpdated += EyetrackerUpdated;
_trackerBrowser.EyeTrackerRemoved += EyetrackerRemoved;
}
开发者ID:shimins,项目名称:Eyetracking,代码行数:13,代码来源:TrackerForm.cs
示例19: Run
public void Run(Clock clock, IClimateSO2CycleState state, IDimensions dimensions)
{
// create shortcuts for commonly accessed data
var s = state;
var t = clock.Current;
if (clock.IsFirstTimestep)
{
}
else
{
// Calculate SO2 concentrations
s.acso2[t] = s.globso2[t];
}
}
开发者ID:VWille,项目名称:fund,代码行数:16,代码来源:ClimateSO2CycleComponent.cs
示例20: Start
/// <summary>
/// 启动计时器
/// </summary>
/// <param name="interval">计时器间隔</param>
/// <param name="count">执行次数</param>
/// <param name="key">计时器标志</param>
/// <param name="func">回调函数</param>
public static bool Start(float interval, int count, string key, TimerCallBackHandle func)
{
Clock ck = new Clock();
if (!mapClock.ContainsKey(key))
{
mapClock.Add(key, ck);
ck.Start(interval, count, func);
}
else
{
return false;
}
return true;
}
开发者ID:FP-GAME-DEV-TEAM,项目名称:CSharpDx_Game,代码行数:23,代码来源:TimerUtils.cs
注:本文中的System.Clock类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论