Skip to content

Commit 584ebf6

Browse files
committed
Merge pull request #1 from 4c656554/hp
Timer
2 parents f2b1441 + 1d94fd7 commit 584ebf6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyCREST.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from random import random
3333
import math
3434
import csv
35+
import time
3536

3637

3738
def create_profiles(n=1,month=7,daytype='weekday'):
@@ -70,6 +71,8 @@ def create_profiles(n=1,month=7,daytype='weekday'):
7071

7172

7273
for i in range (0,no_its):
74+
if i==0:
75+
time1 = time.time()
7376
appliances_in_dwelling = ConfigureAppliancesInDwelling(appliances)
7477

7578
activity_stats = numpy.genfromtxt('activity_stats.dat',skip_header=11,dtype=(None))
@@ -337,7 +340,9 @@ def create_profiles(n=1,month=7,daytype='weekday'):
337340
# plt.savefig('out_'+idstring+'.png')
338341

339342
###################################################################################################################
340-
343+
if i==0:
344+
timet = time.time()-time1
345+
print 'Approx time to completion = ' + str(timet*n) + ' seconds.'
341346
# save sim_data to file here
342347
Pfile = open('Pfile_'+idstring+'.dat', 'w')
343348

@@ -357,7 +362,8 @@ def create_profiles(n=1,month=7,daytype='weekday'):
357362
Appliancesfile.writelines("%s\t" % item)
358363
Appliancesfile.write("\n")
359364
Appliancesfile.close
360-
365+
timet = time.time()-time1
366+
print 'Actual time to completion = ' + str(timet) + ' seconds.'
361367

362368

363369

0 commit comments

Comments
 (0)