import time import stringmatchers if __name__ == '__main__': # Reading the data for the test datafile = open("sample_sequence.txt") sequence = datafile.read(100000) search_sequence = "ATCGATCGATCGC" # This way of calling functions will not be on the exams funs = (stringmatchers.get_indices,stringmatchers.basic_stringmatch,\ stringmatchers.early_exit_stringmatch) for f in funs: t1 = time.time() f(sequence, search_sequence) t2 = time.time() print "Elapsed time for",f, str(t2 - t1)