FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ProcessSandbox/Example/Program.cs at main · AlexMAS/ProcessSandbox · GitHub
AlexMAS
/
ProcessSandbox
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ProcessSandbox
/
Example
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (24 loc) · 1002 Bytes
Breadcrumbs
ProcessSandbox
/
Example
/
Program.cs
Copy path
File metadata and controls
29 lines (24 loc) · 1002 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace
Example
;
using
ProcessSandbox
;
internal
class
Program
{
static
async
Task
Main
(
string
[
]
args
)
{
var
processSandbox
=
new
ProcessSandbox
(
new
(
)
{
Command
=
args
[
0
]
,
Arguments
=
args
[
1
..
]
,
CpuLimit
=
TimeSpan
.
FromSeconds
(
5
)
,
MemoryLimit
=
10
*
1024
*
1024
,
}
)
;
Console
.
WriteLine
(
$
"EXECUTE >>>
{
Environment
.
CommandLine
}
"
)
;
Console
.
WriteLine
(
$
"OUTPUT >>>"
)
;
await
processSandbox
.
Start
(
)
;
Console
.
WriteLine
(
"EXECUTION RESULT >>>"
)
;
Console
.
WriteLine
(
$
"Exit Code :
{
processSandbox
.
ExitCode
}
"
)
;
Console
.
WriteLine
(
$
"Self Completion :
{
processSandbox
.
SelfCompletion
}
"
)
;
Console
.
WriteLine
(
$
"Elapsed Time, ms :
{
processSandbox
.
ElapsedTime
.
TotalMilliseconds
}
"
)
;
Console
.
WriteLine
(
$
"CPU Usage, ms :
{
processSandbox
.
CpuUsage
.
TotalMilliseconds
}
"
)
;
Console
.
WriteLine
(
$
"Memory Usage, bytes:
{
processSandbox
.
MemoryUsage
}
"
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL