-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimulate_fps_cosine.bat
46 lines (37 loc) · 1.2 KB
/
simulate_fps_cosine.bat
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
@echo off
setlocal enabledelayedexpansion
rem Simulate FPS counter by waiting 0.1 seconds between calculations
set waitTime=0.1
rem Loop through values from 1 to 400
for /L %%i in (1,1,400) do (
rem Clear the screen
cls
rem Calculate the cosine using PowerShell
for /f %%c in ('powershell -command "[math]::cos(%%i)"') do (
set cosValue=%%c
)
rem Display the FPS counter and cosine value
echo FPS: %%i
echo Cosine of %%i = !cosValue!
rem Wait for a short period to simulate FPS (100 milliseconds)
powershell -command "Start-Sleep -Seconds %waitTime%"
)
rem Add 4 processes of cos(1:400)
for /L %%j in (1,1,4) do (
rem Calculate the cosine using PowerShell
for /L %%i in (1,1,400) do (
for /f %%c in ('powershell -command "[math]::cos(%%i)"') do (
set cosValue=%%c
)
)
rem Display the FPS counter and cosine value
echo FPS: %%i
echo Cosine of %%i = !cosValue!
rem Wait for a short period to simulate FPS (100 milliseconds)
powershell -command "Start-Sleep -Seconds %waitTime%"
)
setlocal enabledelayedexpansion
echo.
echo Press any key to exit...
pause > nul
endlocal