Updated library and main file to accept the test duration as a command line parameter