199 references to FromTicks
aspire (1)
src\Shared\Otlp\OtlpHelpers.cs (1)
74
return TimeSpan.
FromTicks
(NanosecondsToTicks(nanoseconds));
Aspire.Cli.Tests (3)
ProfileCaptureServiceTests.cs (3)
199
timeProvider.Advance(s_testTimeout + TimeSpan.
FromTicks
(1));
263
timeProvider.Advance(s_testTimeout + TimeSpan.
FromTicks
(1));
593
timeoutTimeProvider?.Advance(s_testTimeout + TimeSpan.
FromTicks
(1));
Aspire.Dashboard (5)
Components\Controls\Chart\ChartContainer.razor.cs (1)
299
var historyDuration = TimeSpan.
FromTicks
(Math.Max(TimeSpan.FromSeconds(30).Ticks, dataPointInterval.Ticks));
Otlp\Storage\SqliteTelemetryRepository.Traces.Reads.cs (3)
53
MaxDuration = TimeSpan.
FromTicks
(aggregate.MaxDurationTicks)
150
Duration = TimeSpan.
FromTicks
(trace.DurationTicks!.Value),
171
MaxDuration = TimeSpan.
FromTicks
(firstRecord.MaxDurationTicks)
src\Shared\Otlp\OtlpHelpers.cs (1)
74
return TimeSpan.
FromTicks
(NanosecondsToTicks(nanoseconds));
Aspire.Dashboard.Tests (12)
DurationFormatterTests.cs (12)
26
Assert.Equal(unit, DurationFormatter.GetUnit(TimeSpan.
FromTicks
(ticks)));
32
Assert.Equal("1μs", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(1 * TimeSpan.TicksPerMicrosecond), CultureInfo.CurrentCulture));
39
Assert.Equal("10d 14h", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
46
Assert.Equal("2d", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
53
Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
60
Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
67
Assert.Equal("2m 31s", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
74
Assert.Equal("2h 31m", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
81
Assert.Equal(0.92m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
88
Assert.Equal(0.92m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
95
Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.
FromTicks
((long)input), CultureInfo.CurrentCulture));
102
Assert.Equal("0μs", DurationFormatter.FormatDuration(TimeSpan.
FromTicks
(input), CultureInfo.CurrentCulture));
dotnet (2)
Commands\Test\MTP\TestApplicationHandler.cs (2)
340
testResult.Duration.HasValue ? TimeSpan.
FromTicks
(testResult.Duration.Value) : null,
356
testResult.Duration.HasValue ? TimeSpan.
FromTicks
(testResult.Duration.Value) : null,
dotnet-svcutil-lib (5)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (1)
492
return TimeSpan.
FromTicks
(value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\InMemoryNonceCache.cs (1)
60
: base(s_lowWaterMark, maxCachedNonces, s_comparer, PurgingMode.AccessBasedPurge, TimeSpan.
FromTicks
(cachingTimeSpan.Ticks >> 2), false)
FrameworkFork\System.ServiceModel\System\ServiceModel\TimeSpanHelper.cs (3)
14
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerMinute * minutes);
20
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerSecond * seconds);
26
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerMillisecond * ms);
Microsoft.Arcade.Common (1)
ExponentialRetry.cs (1)
82
? TimeSpan.
FromTicks
(Math.Max(exponentialDelay.Ticks, retryAfter.Ticks))
Microsoft.AspNetCore.DataProtection (1)
KeyManagement\KeyRingProvider.cs (1)
528
return TimeSpan.
FromTicks
((long)(refreshPeriod.Ticks * (1.0d - (JitterRandom.NextDouble() / 5))));
Microsoft.AspNetCore.Http.Results (1)
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
393
return dateTimeOffset.Subtract(TimeSpan.
FromTicks
(ticksToRemove));
Microsoft.AspNetCore.Mvc.Core (1)
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
393
return dateTimeOffset.Subtract(TimeSpan.
FromTicks
(ticksToRemove));
Microsoft.Build (2)
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1293
kvp => TimeSpan.
FromTicks
(long.Parse(kvp.Value))));
Logging\ParallelLogger\ParallelConsoleLogger.cs (1)
1754
elapsedTime += (TimeSpan.
FromTicks
(eventTimeStamp.Ticks - (long)time));
Microsoft.Build.Framework (3)
BinaryReaderExtensions.cs (1)
132
TimeSpan value = TimeSpan.
FromTicks
(reader.ReadInt64());
BuildCheck\BuildCheckEventArgs.cs (1)
107
TimeSpan totalRuntime = TimeSpan.
FromTicks
(reader.ReadInt64());
Telemetry\WorkerNodeTelemetryEventArgs.cs (1)
47
var cumulativeExecutionTime = TimeSpan.
FromTicks
(reader.ReadInt64());
Microsoft.CodeAnalysis (3)
DiagnosticAnalyzer\AnalyzerExecutor.cs (3)
49
/// The values in this map convert to <see cref="TimeSpan"/> using <see cref="TimeSpan.
FromTicks
(long)"/>.
234
return _analyzerExecutionTimeMap.ToImmutableDictionary(pair => pair.Key, pair => TimeSpan.
FromTicks
(pair.Value.Value));
1696
return TimeSpan.
FromTicks
(executionTime.Value);
Microsoft.Extensions.Caching.Hybrid (1)
Internal\DefaultHybridCache.TagInvalidation.cs (1)
196
internal static TimeSpan TicksToTimeSpan(long ticks) => TimeSpan.
FromTicks
(ticks);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Snapshot.cs (1)
81
TotalTimeSinceStart = TimeSpan.
FromTicks
(timeProvider.GetUtcNow().Ticks);
Windows\WindowsContainerSnapshotProvider.cs (3)
164
TimeSpan.
FromTicks
(_timeProvider.GetUtcNow().Ticks),
165
TimeSpan.
FromTicks
(basicAccountingInfo.TotalKernelTime),
166
TimeSpan.
FromTicks
(basicAccountingInfo.TotalUserTime),
Windows\WindowsSnapshotProvider.cs (1)
110
totalTimeSinceStart: TimeSpan.
FromTicks
(_timeProvider.GetUtcNow().Ticks),
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (38)
CalculatorTests.cs (16)
19
totalTimeSinceStart: TimeSpan.
FromTicks
(new FakeTimeProvider().GetUtcNow().Ticks),
20
kernelTimeSinceStart: TimeSpan.
FromTicks
(0),
21
userTimeSinceStart: TimeSpan.
FromTicks
(0),
40
kernelTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 4),
43
userTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 4),
75
kernelTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 4),
78
userTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 4),
122
totalTimeSinceStart: TimeSpan.
FromTicks
(new FakeTimeProvider().GetUtcNow().Ticks),
123
kernelTimeSinceStart: TimeSpan.
FromTicks
(1000),
124
userTimeSinceStart: TimeSpan.
FromTicks
(1000),
129
kernelTimeSinceStart: TimeSpan.
FromTicks
(firstSnapshot.KernelTimeSinceStart.Ticks - 1),
130
userTimeSinceStart: TimeSpan.
FromTicks
(firstSnapshot.UserTimeSinceStart.Ticks - 1));
151
kernelTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 2),
152
userTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks / 2),
185
kernelTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks),
186
userTimeSinceStart: TimeSpan.
FromTicks
(totalAvailableTicks),
Helpers\DummyProvider.cs (3)
12
public static readonly TimeSpan KernelTimeSinceStart = TimeSpan.
FromTicks
(1000);
17
public static readonly TimeSpan UserTimeSinceStart = TimeSpan.
FromTicks
(1000);
28
totalTimeSinceStart: TimeSpan.
FromTicks
(SnapshotTimeClock.GetUtcNow().Ticks),
Providers\ConditionallyFaultProvider.cs (1)
35
TimeSpan.
FromTicks
(new FakeTimeProvider().GetUtcNow().Ticks),
Providers\FakeProvider.cs (1)
12
TimeSpan.
FromTicks
(new FakeTimeProvider().GetUtcNow().Ticks),
Providers\FaultProvider.cs (1)
25
return new Snapshot(TimeSpan.
FromTicks
(_clock.GetUtcNow().Ticks), TimeSpan.Zero, TimeSpan.Zero, ulong.MaxValue);
ResourceMonitoringOptionsValidatorTests.cs (1)
34
CollectionWindow = TimeSpan.
FromTicks
(1),
ResourceMonitoringServiceTests.cs (14)
406
TimeSpan.
FromTicks
(clock.GetUtcNow().Ticks),
420
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks),
425
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks),
430
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks),
435
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks),
440
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks),
489
clock.Advance(TimeSpan.
FromTicks
(1));
513
TimeSpan.
FromTicks
(clock.GetUtcNow().Ticks),
526
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod).Ticks),
531
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 2).Ticks),
536
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 3).Ticks),
541
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 4).Ticks),
546
TimeSpan.
FromTicks
(clock.GetUtcNow().AddMilliseconds(TimerPeriod * 5).Ticks),
661
TimeSpan.
FromTicks
(_clock.GetUtcNow().Ticks),
SnapshotTests.cs (1)
18
var snapshot = new Snapshot(TimeSpan.
FromTicks
(time.GetUtcNow().Ticks), TimeSpan.Zero, TimeSpan.FromSeconds(1), 10);
Microsoft.Extensions.ServiceDiscovery.Dns (1)
DnsServiceEndpointProviderBase.cs (1)
147
return TimeSpan.
FromTicks
(nextTicks);
Microsoft.Extensions.TimeProvider.Testing.Tests (5)
FakeTimeProviderTests.cs (4)
212
Assert.Throws<ArgumentOutOfRangeException>(() => timeProvider.Advance(TimeSpan.
FromTicks
(-1)));
220
Assert.Throws<ArgumentOutOfRangeException>(() => timeProvider.SetUtcNow(timeProvider.GetUtcNow() - TimeSpan.
FromTicks
(1)));
351
await Assert.ThrowsAsync<TaskCanceledException>(() => timeProvider.Delay(TimeSpan.
FromTicks
(1), cts.Token));
364
await Assert.ThrowsAsync<ArgumentOutOfRangeException>(() => source.Task.WaitAsync(TimeSpan.
FromTicks
(-1), timeProvider, CancellationToken.None));
TimerTests.cs (1)
340
timeProvider.Advance(TimeSpan.
FromTicks
(1));
Microsoft.Maui.Controls.Build.Tasks (1)
PerformanceProvider.cs (1)
66
double total = TimeSpan.
FromTicks
(kvp.Value.TotalTime).TotalMilliseconds;
NuGet.Protocol (1)
Plugins\ProtocolConstants.cs (1)
38
public static readonly TimeSpan MinTimeout = TimeSpan.
FromTicks
(1);
PresentationCore (69)
System\Windows\Media\Animation\Clock.cs (8)
2086
localProgress = TimeSpan.
FromTicks
(offsetFromBegin.Ticks % _currentDuration.TimeSpan.Ticks);
2204
localProgress = TimeSpan.
FromTicks
(offsetOnLaterIterations % _resolvedDuration.TimeSpan.Ticks);
2404
_currentTime = TimeSpan.
FromTicks
((long)((t * durationInTicks) + 0.5));
2538
effectiveDuration = TimeSpan.
FromTicks
((long)(presentAndFutureDuration / _appliedSpeedRatio + 0.5)) + previousIterationDuration;
3205
_syncData.PreviousSyncClockTime = TimeSpan.
FromTicks
(ourSyncTimeST.Ticks % syncClockDuration.TimeSpan.Ticks);
3516
return TimeSpan.
FromTicks
(desiredFrameTick);
3654
return TimeSpan.
FromTicks
((long)(((double)timeSpan.Ticks) / factor + 0.5));
3672
return TimeSpan.
FromTicks
((long)(factor * (double)timeSpan.Ticks + 0.5));
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (1)
769
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (1)
769
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (1)
769
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (1)
769
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (1)
769
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
System\Windows\Media\Animation\TimeIntervalCollection.cs (26)
1101
projection.InitializePoint(TimeSpan.
FromTicks
(outputInTicks));
1269
projection.CurrentNodeTime = TimeSpan.
FromTicks
((long)(speedRatio * timeOffset));
1287
projection.CurrentNodeTime = TimeSpan.
FromTicks
((long)(speedRatio * timeOffset));
1375
projection.MergePoint(TimeSpan.
FromTicks
(currentProjection));
1441
TimeSpan.
FromTicks
(currentProjection), includeTime);
1446
projection.MergeInterval(TimeSpan.
FromTicks
(currentProjection), includeTime,
1447
TimeSpan.
FromTicks
(periodInTicks), true);
1458
TimeSpan.
FromTicks
(clippedTime), NextNodeIsPoint);
1465
projection.MergeInterval(TimeSpan.
FromTicks
(clippedTime), NextNodeIsPoint,
1466
TimeSpan.
FromTicks
(periodInTicks), true);
1477
projection.MergeInterval(TimeSpan.
FromTicks
(currentProjection - intervalLength), NextNodeIsPoint,
1478
TimeSpan.
FromTicks
(currentProjection), CurrentNodeIsPoint);
1482
projection.MergeInterval(TimeSpan.
FromTicks
(currentProjection), CurrentNodeIsPoint,
1483
TimeSpan.
FromTicks
(currentProjection + intervalLength), NextNodeIsPoint);
1503
projection._nodeTime[1] = TimeSpan.
FromTicks
(periodInTicks);
1513
projection.MergeInterval(TimeSpan.
FromTicks
(currentProjection), CurrentNodeIsPoint,
1514
TimeSpan.
FromTicks
(periodInTicks), false);
1518
TimeSpan.
FromTicks
(intervalLength - timeBeforeNextPeriod), NextNodeIsPoint);
1524
projection.MergePoint(TimeSpan.
FromTicks
(periodInTicks));
1536
projection.MergeInterval(TimeSpan.
FromTicks
(currentProjection), CurrentNodeIsPoint,
1537
TimeSpan.
FromTicks
(currentProjection + intervalLength), NextNodeIsPoint);
1821
TimeSpan accelEnd = TimeSpan.
FromTicks
((long)(dpPeriod * accelRatio));
1822
TimeSpan decelStart = TimeSpan.
FromTicks
(periodInTicks - (long)(dpPeriod * decelRatio));
1832
_nodeTime[_current] = TimeSpan.
FromTicks
((long)(halfMaxRate * inversePeriod * t * t / accelRatio));
1840
_nodeTime[_current] = TimeSpan.
FromTicks
((long)(halfMaxRate * (2 * t - (accelRatio * dpPeriod))));
1848
_nodeTime[_current] = TimeSpan.
FromTicks
(periodInTicks - (long)(halfMaxRate * inversePeriod * t * t / decelRatio));
System\Windows\Media\Animation\TimeManager.cs (3)
446
return TimeSpan.
FromTicks
(DateTime.Now.Ticks);
782
return TimeSpan.
FromTicks
(-1);
788
return TimeSpan.
FromTicks
(-1);
System\Windows\Media\mediaclock.cs (1)
93
_mediaPlayer.SetPosition(TimeSpan.
FromTicks
(0));
System\Windows\Media\MediaContext.cs (7)
194
_estimatedNextPresentationTime = TimeSpan.
FromTicks
(CountsToTicks(_lastPresentationTime));
566
nextTickNeeded = TimeSpan.
FromTicks
(Math.Max(nextTickNeeded.Ticks, minimumDelay.Ticks));
661
_estimatedNextVSyncTimer.Interval = TimeSpan.
FromTicks
(earliestWakeupTicks - currentTicks);
1168
_estimatedNextPresentationTime = TimeSpan.
FromTicks
(nextPresentationTicks);
1173
_estimatedNextPresentationTime = TimeSpan.
FromTicks
(countsTicks);
1178
_estimatedNextPresentationTime = TimeSpan.
FromTicks
(countsTicks);
2527
timer.Interval = TimeSpan.
FromTicks
(earliestWakeupTicks - currentTicks);
System\Windows\Media\MediaPlayerState.cs (3)
394
return new Duration(TimeSpan.
FromTicks
(mediaLength));
697
Position = TimeSpan.
FromTicks
(0);
911
return TimeSpan.
FromTicks
(position);
PresentationFramework (1)
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (1)
861
TimeSpan uniformTimeStep = TimeSpan.
FromTicks
((_sortedResolvedKeyFrames[block.EndIndex]._resolvedKeyTime - blockBeginTime).Ticks / segmentCount);
Shared.Tests (14)
Data.Validation\TimeSpanAttributeTests.cs (14)
36
options.Time = TimeSpan.
FromTicks
(-1);
42
options.Time = TimeSpan.
FromTicks
(TimeSpan.FromMilliseconds(10).Ticks + 1);
49
options.Time = TimeSpan.
FromTicks
(0);
61
options.Time2 = TimeSpan.
FromTicks
(-1);
67
options.Time2 = TimeSpan.
FromTicks
(0);
101
options.Time = TimeSpan.
FromTicks
(0);
121
options.Time2 = TimeSpan.
FromTicks
(-1);
128
options.Time2 = TimeSpan.
FromTicks
(0);
164
options.Time = TimeSpan.
FromTicks
(-1);
170
options.Time = TimeSpan.
FromTicks
(TimeSpan.FromMilliseconds(10).Ticks + 1);
177
options.Time = TimeSpan.
FromTicks
(0);
189
options.Time2 = TimeSpan.
FromTicks
(-1);
195
options.Time2 = TimeSpan.
FromTicks
(0);
246
var value = TimeSpan.
FromTicks
(-1);
System.Data.Common (3)
System\Data\Common\TimeSpanStorage.cs (3)
82
return TimeSpan.
FromTicks
((long)Math.Round(sum));
100
return TimeSpan.
FromTicks
((long)Math.Round(meanSum / meanCount));
134
return TimeSpan.
FromTicks
((long)stDev);
System.Management (1)
System\Management\ManagementDateTime.cs (1)
371
TimeSpan tsTemp = System.TimeSpan.
FromTicks
(ticks);
System.Net.Http (3)
System\Net\Http\Headers\AltSvcHeaderParser.cs (1)
176
TimeSpan maxAgeTimeSpan = TimeSpan.
FromTicks
(maxAge * TimeSpan.TicksPerSecond ?? DefaultMaxAgeTicks);
System\Net\Http\Headers\AltSvcHeaderValue.cs (1)
72
if (MaxAge != TimeSpan.
FromTicks
(AltSvcHeaderParser.DefaultMaxAgeTicks))
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (1)
720
nextAuthorityMaxAge = TimeSpan.
FromTicks
(30 * TimeSpan.TicksPerDay);
System.Private.CoreLib (3)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\JitInfo.cs (1)
20
return TimeSpan.
FromTicks
(GetCompilationTimeInTicks(currentThread));
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
443
return TimeSpan.
FromTicks
(units * ticksPerUnit);
620
return TimeSpan.
FromTicks
(ticks);
System.Private.DataContractSerialization (1)
System\Xml\XmlBufferReader.cs (1)
449
return TimeSpan.
FromTicks
(value);
System.ServiceModel.NetNamedPipe (1)
System\Runtime\BackoffTimeoutHelper.cs (1)
86
_waitTime = TimeSpan.
FromTicks
(_waitTime.Ticks * 2);
System.ServiceModel.Primitives (5)
System\ServiceModel\Security\InMemoryNonceCache.cs (1)
61
: base(s_lowWaterMark, maxCachedNonces, s_comparer, PurgingMode.AccessBasedPurge, TimeSpan.
FromTicks
(cachingTimeSpan.Ticks >> 2), false)
System\ServiceModel\Security\SecuritySessionClientSettings.cs (1)
958
TimeSpan tokenValidityInterval = TimeSpan.
FromTicks
((long)(((token.ValidTo.Ticks - token.ValidFrom.Ticks) * Settings._issuedTokenRenewalThreshold) / 100));
System\ServiceModel\TimeSpanHelper.cs (3)
15
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerMinute * minutes);
21
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerSecond * seconds);
27
TimeSpan value = TimeSpan.
FromTicks
(TimeSpan.TicksPerMillisecond * ms);
System.Speech (2)
Internal\Synthesis\EngineSite.cs (1)
481
TimeSpan.
FromTicks
(totalDurationTicks),
Recognition\RecognizerBase.cs (1)
601
TimeSpan eventTimeout = TimeSpan.
FromTicks
(Math.Max(initialSilenceTimeout.Ticks, _defaultTimeout.Ticks));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (1)
203
public TimeSpan MatchTimeout { get; } = TimeSpan.
FromTicks
(-1);
System.Threading.RateLimiting (2)
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (1)
281
return new SlidingWindowLease(false, TimeSpan.
FromTicks
(remainingTicks));
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (1)
222
return new TokenBucketLease(false, TimeSpan.
FromTicks
(_options.ReplenishmentPeriod.Ticks * replenishPeriods));
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Animation\HighPrecisionTimer.cs (1)
584
=> TimeSpan.
FromTicks
(StopwatchTicksToTimeSpanTicks(stopwatchTicks));