Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
04de5d83
Commit
04de5d83
authored
5 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add SystemChecks.Uptime
Refers to
#20
parent
e8d7c45c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/SystemChecks.cs
+10
-0
10 additions, 0 deletions
ATxCommon/SystemChecks.cs
with
10 additions
and
0 deletions
ATxCommon/SystemChecks.cs
+
10
−
0
View file @
04de5d83
...
...
@@ -150,5 +150,15 @@ namespace ATxCommon
Log
.
Debug
(
"Currently running processes: {0}"
,
procs
.
Substring
(
2
));
}
}
/// <summary>
/// Get the current system uptime in seconds. Note that this will miss all times where the
/// system had been suspended / hibernated, as it is based on the OS's ticks counter.
/// </summary>
/// <returns>The time since the last system boot in seconds.</returns>
public
static
long
Uptime
()
{
var
ticks
=
Stopwatch
.
GetTimestamp
();
return
ticks
/
Stopwatch
.
Frequency
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment