#!/bin/bash

START_TIME=$SECONDS

for i in {1..4}
do
	psql -d mydb -f insert_txn[${i}].sql &
	pids[${i}]=$!
done

for pid in ${pids[*]}
do
	wait $pid
done

ELAPSED_TIME=$(($SECONDS - $START_TIME))
echo $ELAPSED_TIME "secs."
