#!/bin/bash
if [ "$#" = "0" ];then
    echo "Usage: $0 [program to profile] [args to program]"
    exit 1
fi

make clean
make
time $@ > analysis.txt
gprof $1 gmon.out >> analysis.txt
nano analysis.txt
