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" # Determine how long the stringmatching function takes t1 = time.time() stringmatchers.get_indices(sequence, search_sequence) t2 = time.time() print "Elapsed time for get_indices: " + str(t2 - t1) t1 = time.time() stringmatchers.basic_stringmatch(sequence, search_sequence) t2 = time.time() print "Elapsed time for basic_stringmatch: " + str(t2 - t1) t1 = time.time() stringmatchers.early_exit_stringmatch(sequence, search_sequence) t2 = time.time() print "Elapsed time for early_exit_stringmatch: " + str(t2 - t1)