Skip to content

Instantly share code, notes, and snippets.

View Narrator's full-sized avatar

Kaushik Gnanaskandan Narrator

View GitHub Profile
#!/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