本文整理汇总了C#中SteamClient.GetNextJobID方法的典型用法代码示例。如果您正苦于以下问题:C# SteamClient.GetNextJobID方法的具体用法?C# SteamClient.GetNextJobID怎么用?C# SteamClient.GetNextJobID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SteamClient
的用法示例。
在下文中一共展示了SteamClient.GetNextJobID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNextJobIDIsThreadsafe
public void GetNextJobIDIsThreadsafe()
{
var steamClient = new SteamClient();
var jobID = steamClient.GetNextJobID();
Assert.Equal(1u, jobID.SequentialCount);
Parallel.For(0, 1000, x =>
{
steamClient.GetNextJobID();
});
jobID = steamClient.GetNextJobID();
Assert.Equal(1002u, jobID.SequentialCount);
}
示例2: GetNextJobIDSetsProcessIDToZero
public void GetNextJobIDSetsProcessIDToZero()
{
var steamClient = new SteamClient();
var jobID = steamClient.GetNextJobID();
Assert.Equal(0u, jobID.ProcessID);
}
示例3: GetNextJobIDFillsProcessStartTime
public void GetNextJobIDFillsProcessStartTime()
{
var steamClient = new SteamClient();
var jobID = steamClient.GetNextJobID();
using (var process = Process.GetCurrentProcess())
{
var processStartTime = process.StartTime;
// Recreate the datetime to get rid of milliseconds etc. and only keep the important bits
var expectedProcessStartTime = new DateTime(processStartTime.Year, processStartTime.Month, processStartTime.Day, processStartTime.Hour, processStartTime.Minute, processStartTime.Second);
Assert.Equal(expectedProcessStartTime, jobID.StartTime);
}
}
示例4: GetNextJobIDSetsBoxIDToZero
public void GetNextJobIDSetsBoxIDToZero()
{
var steamClient = new SteamClient();
var jobID = steamClient.GetNextJobID();
Assert.Equal(jobID.BoxID, 0u);
}