This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the number of CPU cores | |
NUM_CORES=$(nproc) | |
# Function to perform CPU-intensive calculations | |
cpu_stress() { | |
echo "Starting task on process $$" | |
start_time=$(date +%s.%N) | |
echo "scale=5000; a(1)*4" | bc -l > /dev/null |