Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/rmit.py

    r7a2a3af rdbb1073  
    1010
    1111import argparse
     12import datetime
    1213import itertools
    1314import os
     
    101102        return nopts
    102103
     104def actions_eta(actions):
     105        time = 0
     106        for a in actions:
     107                i = 0
     108                while i < len(a):
     109                        if a[i] == '-d':
     110                                i += 1
     111                                if i != len(a):
     112                                        time += int(a[i])
     113                        i += 1
     114        return time
     115
    103116if __name__ == "__main__":
    104117        # ================================================================================
     
    160173        # ================================================================================
    161174        # Prepare to run
     175        print(actions)
     176
     177        # find expected time
     178        time = actions_eta(actions)
     179        print("Running {} trials{}".format(len(actions), "" if time == 0 else " (expecting to take {}".format(str(datetime.timedelta(seconds=int(time)))) ))
     180
    162181        random.shuffle(actions)
    163 
    164         print("Running {} trials".format(len(actions)))
    165182        result = []
    166183
Note: See TracChangeset for help on using the changeset viewer.