Index: testPobyso.sage
===================================================================
--- testPobyso.sage	(revision 116)
+++ testPobyso.sage	(revision 117)
@@ -13,6 +13,7 @@
 #
 import inspect
 import resource
+import timeit
 
 
 def memory_usage_resource():
@@ -24,6 +25,11 @@
     return mem
 # End memory_usage_resource()
 
+def test_pobyso_wrapper(func, *args, **kwargs):
+    def wrapped():
+        return func(*args, **kwargs)
+    return wrapped
+
 #
 def test_pobyso_absolute_so_so():
     for index in xrange(0,1000000):
@@ -38,21 +44,47 @@
     sollya_lib_clear_obj(absoluteSo)
 # End test_pobyso_autoprint
 
-def test_pobyso_bounds_to_range_sa_so(iterationsNum=10000):
-    global t
-    print "Running", inspect.stack()[0][3]
+def test_pobyso_bounds_to_range_sa_so(repeat=1000, number=10):
+    functionName =  inspect.stack()[0][3]
+    print "Running", inspect.stack()[0][3], "..."
     lowerBoundSa = RR(1)
     upperBoundSa = RR(2)
     precSo = pobyso_get_prec_so()
-    pobyso_autoprint(precSo)
-    for index in xrange(0,iterationsNum):
+    #pobyso_autoprint(precSo)
+    #
+    def test(lowerBoundSa, upperBoundSa):
         rangeSo = pobyso_bounds_to_range_sa_so(lowerBoundSa, upperBoundSa)
         sollya_lib_clear_obj(rangeSo)
+    #
+    wrapped = test_pobyso_wrapper(test,lowerBoundSa, upperBoundSa)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    #
     precSo = pobyso_get_prec_so()
-    pobyso_autoprint(precSo)
+    #pobyso_autoprint(precSo)
     sollya_lib_clear_obj(precSo)
+    print "\t...", functionName, "done."
+    return timing
 # End test_pobyso_bounds_to_range_sa_so
 
+def test_pobyso_get_list_elements_so_so(repeat = 1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
+    def test():
+        listSo = pobyso_parse_string_sa_so("[|0,1,2,3,4,5,6|];")
+        (listSaSo, elementsNumSa, isEndEllipticSa) = \
+            pobyso_get_list_elements(listSo)
+        for elementSo in listSaSo:
+            sollya_lib_clear_obj(elementSo)
+        # Notice that we use sollya_lib_clear_obj and not
+        # sollya_lib_clear_object_list.
+        sollya_lib_clear_obj(listSo, None)
+    #
+    wrapped = test_pobyso_wrapper(test)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    print "\t...", functionName, "done."
+    return timing
+# End test_pobyso_get_list_elements    
+
 def test_pobyso_get_prec_so_sa(iterationsNum=10000):
     print "Running", inspect.stack()[0][3]
     for index in xrange(0,iterationsNum):
@@ -84,12 +116,14 @@
         sollya_lib_clear_obj(expressionSo)
 # End pobyso_parse_string_sa_so
 
-def test_pobyso_taylor_expansion_no_change_var_so_so(iterationsNum=10000):
+def test_pobyso_taylor_expansion_no_change_var_so_so(repeat=1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
     functionSo  = pobyso_parse_string('exp(x)')
     degreeSo    = pobyso_constant_from_int_sa_so(20)
     rangeSo     = pobyso_bounds_to_range_sa_so(RR(1),RR(2))
     errorTypeSo = pobyso_absolute_so_so()
-    for index in xrange(0,iterationsNum):
+    def test(functionSo, degreeSo, rangeSo, errorTypeSo):
         teSo = pobyso_taylor_expansion_no_change_var_so_so(functionSo,
                                                            degreeSo,
                                                            rangeSo,
@@ -97,10 +131,55 @@
         sollya_lib_clear_obj(teSo[0])
         sollya_lib_clear_obj(teSo[1])
         sollya_lib_clear_obj(teSo[2])
+    # End test
+    wrapped = test_pobyso_wrapper(test, 
+                                  functionSo, 
+                                  degreeSo, 
+                                  rangeSo, 
+                                  errorTypeSo)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
     sollya_lib_clear_obj(functionSo)
     sollya_lib_clear_obj(degreeSo)
     sollya_lib_clear_obj(rangeSo)
     sollya_lib_clear_obj(errorTypeSo)
+    print "\t...", functionName, "done."
+    return timing
 # End test_pobyso_taylor_expansion_no_change_var_so_so
 
+def test_pobyso_taylor_form_so_so_2(repeat=1000, number=10):
+    functionName = inspect.stack()[0][3]
+    print "Running", functionName, "..."
+    functionSo  = pobyso_parse_string('exp(x)')
+    degreeSo    = pobyso_constant_from_int_sa_so(20)
+    rangeSo     = pobyso_bounds_to_range_sa_so(RR(1),RR(2))
+    intervalCenterSo = sollya_lib_mid(rangeSo, None)
+    errorTypeSo = pobyso_absolute_so_so()
+    
+    def test(functionSo, degreeSo, intervalCenterSo, errorTypeSo):
+        taylorformSo = pobyso_taylorform_so_so(functionSo, 
+                                               degreeSo, 
+                                               intervalCenterSo, 
+                                               errorTypeSo)
+        sollya_lib_clear_obj(taylorformSo)
+    wrapped = test_pobyso_wrapper(test, 
+                                  functionSo, 
+                                  degreeSo, 
+                                  intervalCenterSo, 
+                                  errorTypeSo)
+    timing = min(timeit.repeat(wrapped, repeat=repeat, number=number))
+    sollya_lib_clear_obj(functionSo,None)
+    sollya_lib_clear_obj(degreeSo,None)
+    sollya_lib_clear_obj(rangeSo,None)
+    sollya_lib_clear_obj(intervalCenterSo,None)
+    sollya_lib_clear_obj(errorTypeSo,None)
+    return timing
+# End   test_pobyso_taylor_so_so_2
+ 
+def test_pobyso_dummy_test(iterationsNum=1, executionsNum=1):
+    aString = "2+3"
+    def test():
+        return 2+3
+    wrapped = test_pobyso_wrapper(test)
+    timing = timeit.timeit(wrapped, number=executionsNum)
+    return timing
 print "\t...testPobyso loaded"
\ No newline at end of file
