Changeset 3674 for trunk/GSASIIobj.py


Ignore:
Timestamp:
Oct 15, 2018 11:45:38 AM (4 years ago)
Author:
toby
Message:

misc cosmetic & build changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r3599 r3674  
    27772777        {'Limits':[1.,5.],'Background':[2,[0.,-0.2*np.pi],False],'Peaks':[]})
    27782778    return Id
    2779 
     2779#%%
    27802780class ShowTiming(object):
    27812781    '''An object to use for timing repeated sections of code.
     
    27982798       
    27992799    '''
    2800     import time
    28012800    def __init__(self):
    28022801        self.timeSum =  []
     
    28052804        self.prev = None
    28062805    def start(self,label):
     2806        import time
    28072807        if label in self.label:
    28082808            i = self.label.index(label)
     
    28172817        self.prev = i
    28182818    def end(self):
     2819        import time
    28192820        if self.prev is not None:
    28202821            self.timeSum[self.prev] += time.time() - self.timeStart[self.prev]
     
    28252826        for i,(lbl,val) in enumerate(zip(self.label,self.timeSum)):
    28262827            print('{} {:20} {:8.2f} ms {:5.2f}%'.format(i,lbl,1000.*val,100*val/sumT))
    2827 
     2828#%%
    28282829
    28292830if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.