Skip to content

Commit

Permalink
added powershell for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
qlrd committed Nov 5, 2024
1 parent 7c452bc commit 140ca63
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,23 @@ jobs:
- name: Build the project
run: cargo build --release

- name: Run benchmark
- name: Run benchmark (unix)
if: ${{ matrix.os != "windows-latest" }}
run: |
echo "Running benchmark for mining code..."
start_time=$(date +%s%N) # Get start time in nanoseconds
./target/release/mining-btc
end_time=$(date +%s%N) # Get end time in nanoseconds
elapsed_time=$((end_time - start_time)) # Calculate elapsed time
echo "Elapsed time: $((elapsed_time / 1000000)) ms" # Convert to milliseconds
- name: Run benchmark (windows)
if: ${{ matrix.os == "windows-latest" }}
shell: pwsh
run: |
Write-Output "Running benchmark for mining code..."
$startTime = [DateTime]::UtcNow.Ticks
./target/release/mining-btc
$endTime = [DateTime]::UtcNow.Ticks
$elapsedTime = ($endTime - $startTime) / 10000
Write-Output "Elapsed time: $elapsedTime ms"

0 comments on commit 140ca63

Please sign in to comment.