Ignore:
Timestamp:
Oct 18, 2012 11:36:06 AM (10 years ago)
Author:
srkline
Message:

added tic/toc to the SANS_Utilities for quick timing tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANS_Utilities.ipf

    r693 r872  
    1818// 29MAR07 SRK 
    1919// 
     20 
     21///// 
     22// @ IgorExchange 
     23//TicToc 
     24//Posted April 16th, 2009 by bgallarda 
     25//      ¥       in Programming 6.10.x 
     26         
     27function tic() 
     28        variable/G tictoc = startMSTimer 
     29end 
     30  
     31function toc() 
     32        NVAR/Z tictoc 
     33        variable ttTime = stopMSTimer(tictoc) 
     34        printf "%g seconds\r", (ttTime/1e6) 
     35        killvariables/Z tictoc 
     36end 
     37 
     38 
     39Function testTicToc() 
     40  
     41        tic() 
     42        variable i 
     43        For(i=0;i<10000;i+=1) 
     44                make/O/N=512 temp = gnoise(2) 
     45                FFT temp 
     46        Endfor 
     47        killwaves/z temp 
     48        toc() 
     49End 
    2050 
    2151 
Note: See TracChangeset for help on using the changeset viewer.