1; AC, 14/01/2013 at JPL
2; initializing the timing ...
3;
4; revisiting on Nov. 26, 2013
5;
6; under GPL 2 or any later
7;
8pro TIC, vide, profiler=profiler, help=help, test=test
9;
10compile_opt idl2, hidden
11ON_ERROR, 2
12;
13if KEYWORD_SET(help) then begin
14   print, 'pro TIC, name, profiler=profiler, help=help, test=test'
15   return
16endif
17;
18if KEYWORD_SET(profiler) then begin
19   MESSAGE, /continue, 'This /PROFILER keyword is not available, please contribute'
20endif
21;
22if N_PARAMS() GT 1 then MESSAGE, 'Incorrect number of arguments.'
23;
24if N_PARAMS() EQ 1 then vide=''
25;
26t0=SYSTIME(1)
27;
28DEFSYSV, '!TIC', {NAME: '', TIME : t0}
29;
30if KEYWORD_SET(test) then STOP
31;
32end
33;
34; --------------------
35;
36function TIC, name, profiler=profiler, help=help, test=test
37;
38compile_opt idl2, hidden
39ON_ERROR, 2
40;
41if KEYWORD_SET(help) then begin
42   print, 'function TIC, name, profiler=profiler, help=help, test=test'
43   return, !null
44endif
45;
46if KEYWORD_SET(profiler) then begin
47   MESSAGE, /continue, 'This /PROFILER keyword is not available, please contribute'
48endif
49;
50if N_PARAMS() GT 1 then MESSAGE, 'Incorrect number of arguments.'
51;
52if N_PARAMS() EQ 0 then name=''
53;
54t0=SYSTIME(1)
55;
56; since a function call to TIC then TOC is OK, !tic must be set up
57; (the value is wrong but works as expected !)
58;
59DEFSYSV, '!TIC', exist=tic_exist
60if ~tic_exist then DEFSYSV, '!TIC', {NAME: '', TIME : 0.0D}
61;
62if KEYWORD_SET(test) then STOP
63;
64return, {NAME: name, TIME : t0}
65;
66end
67
68