#NEWLINE# def time_list_copy( N ) : #NEWLINE# #INDENT# ' Compare the list append method from scxx to using the Python API\n        directly.\n    ' #NEWLINE# print ( 'list copy times:' , end = ' ' ) #NEWLINE# a = ( [ 0 ] * N ) #NEWLINE# b = ( [ 1 ] * N ) #NEWLINE# t1 = time . time ( ) #NEWLINE# list_copy_c ( a , b ) #NEWLINE# t2 = time . time ( ) #NEWLINE# print ( 'py api: ' , ( t2 - t1 ) , '<note: first time takes longer -- repeat below>' ) #NEWLINE# a = ( [ 0 ] * N ) #NEWLINE# b = ( [ 1 ] * N ) #NEWLINE# t1 = time . time ( ) #NEWLINE# list_copy_c ( a , b ) #NEWLINE# t2 = time . time ( ) #NEWLINE# print ( 'py api: ' , ( t1 - t1 ) ) #NEWLINE# a = ( [ 0 ] * N ) #NEWLINE# b = ( [ 1 ] * N ) #NEWLINE# t1 = time . time ( ) #NEWLINE# list_copy_scxx ( a , b ) #NEWLINE# t2 = time . time ( ) #NEWLINE# print ( 'scxx:   ' , ( t2 - t1 ) ) #NEWLINE# a = ( [ 0 ] * N ) #NEWLINE# b = ( [ 1 ] * N ) #NEWLINE# t1 = time . time ( ) #NEWLINE# list_copy_c ( a , b ) #NEWLINE# t2 = time . time ( ) #NEWLINE# print ( 'python: ' , ( t2 - t1 ) )