Skip to content

Commit

Permalink
update: remove some unnecessary definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Jul 30, 2024
1 parent a19e567 commit d8cc712
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/FpsInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ public static async Task<FpsResult> StartOnceAsync(FpsRequest request)
{
TaskCompletionSource<FpsResult> tcs = new();
FpsResult result = new();
Vector<ulong> presentTimestamps = new(100);
FpsCalculator fps = new();
int pid = (int)request.TargetPid;
Guid dxgKrnlGuid = Microsoft_Windows_DxgKrnl.GUID;
TraceEventID presentEventId = (TraceEventID)Microsoft_Windows_DxgKrnl.Present_Info.Id;

await Task.Run(() =>
Expand Down Expand Up @@ -139,7 +137,7 @@ void OnDynamicAll(TraceEvent data)

/// <see cref="Present"/>
/// <see cref="Microsoft_Windows_DxgKrnl.Name"/>
if (data.ProviderGuid == dxgKrnlGuid)
if (data.ProviderGuid == Microsoft_Windows_DxgKrnl.GUID)
{
if (data.ID == presentEventId)
{
Expand Down Expand Up @@ -170,10 +168,8 @@ public static async Task StartForeverAsync(FpsRequest request, Action<FpsResult>
try
{
FpsResult result = new();
Vector<ulong> presentTimestamps = new(100);
FpsCalculator fps = new();
int pid = (int)request.TargetPid;
Guid dxgKrnlGuid = Microsoft_Windows_DxgKrnl.GUID;
TraceEventID presentEventId = (TraceEventID)Microsoft_Windows_DxgKrnl.Present_Info.Id;

using TraceEventSession session = new(SessionName);
Expand Down Expand Up @@ -212,7 +208,7 @@ void OnDynamicAll(TraceEvent data)

/// <see cref="Present"/>
/// <see cref="Microsoft_Windows_DxgKrnl.Name"/>
if (data.ProviderGuid == dxgKrnlGuid)
if (data.ProviderGuid == Microsoft_Windows_DxgKrnl.GUID)
{
if (data.ID == presentEventId)
{
Expand Down Expand Up @@ -269,8 +265,5 @@ public FpsResult() : this(default)
{
}

public override string ToString()
{
return $"FPS: {Fps}";
}
public override string ToString() => $"FPS: {Fps}";
}

0 comments on commit d8cc712

Please sign in to comment.