Index: /trunk/psLib/pslib.kdevelop
===================================================================
--- /trunk/psLib/pslib.kdevelop	(revision 5082)
+++ /trunk/psLib/pslib.kdevelop	(revision 5083)
@@ -1,194 +1,0 @@
-<?xml version = '1.0'?>
-<kdevelop>
-  <general>
-    <author>Robert Daniel DeSonia</author>
-    <email>robert.desonia@mhpcc.hpc.mil</email>
-    <version>1.6</version>
-    <projectmanagement>KDevAutoProject</projectmanagement>
-    <primarylanguage>C</primarylanguage>
-    <keywords>
-      <keyword>C</keyword>
-      <keyword>Code</keyword>
-    </keywords>
-    <ignoreparts/>
-    <projectdirectory>.</projectdirectory>
-    <absoluteprojectpath>false</absoluteprojectpath>
-    <description/>
-    <secondaryLanguages/>
-  </general>
-  <kdevautoproject>
-    <general>
-      <activetarget>src/pslib</activetarget>
-      <useconfiguration>default</useconfiguration>
-    </general>
-    <run>
-      <mainprogram>src/pslib</mainprogram>
-      <terminal>true</terminal>
-      <directoryradio>executable</directoryradio>
-    </run>
-    <configurations>
-      <optimized>
-        <builddir>optimized</builddir>
-        <ccompiler>kdevgccoptions</ccompiler>
-        <cxxcompiler>kdevgppoptions</cxxcompiler>
-        <f77compiler>kdevg77options</f77compiler>
-        <cflags>-O2 -g0 </cflags>
-      </optimized>
-      <debug>
-        <configargs>--enable-debug=full</configargs>
-        <builddir>debug</builddir>
-        <ccompiler>kdevgccoptions</ccompiler>
-        <cxxcompiler>kdevgppoptions</cxxcompiler>
-        <f77compiler>kdevg77options</f77compiler>
-        <cflags>-O0 -g3 </cflags>
-      </debug>
-    </configurations>
-    <make>
-      <envvars>
-        <envvar value="1" name="WANT_AUTOCONF_2_5" />
-        <envvar value="1" name="WANT_AUTOMAKE_1_6" />
-      </envvars>
-    </make>
-  </kdevautoproject>
-  <kdevdoctreeview>
-    <ignoretocs>
-      <toc>ada</toc>
-      <toc>ada_bugs_gcc</toc>
-      <toc>bash</toc>
-      <toc>bash_bugs</toc>
-      <toc>clanlib</toc>
-      <toc>w3c-dom-level2-html</toc>
-      <toc>fortran_bugs_gcc</toc>
-      <toc>gnome1</toc>
-      <toc>gnustep</toc>
-      <toc>gtk</toc>
-      <toc>gtk_bugs</toc>
-      <toc>haskell</toc>
-      <toc>haskell_bugs_ghc</toc>
-      <toc>java_bugs_gcc</toc>
-      <toc>java_bugs_sun</toc>
-      <toc>kde2book</toc>
-      <toc>libstdc++</toc>
-      <toc>opengl</toc>
-      <toc>pascal_bugs_fp</toc>
-      <toc>php</toc>
-      <toc>php_bugs</toc>
-      <toc>perl</toc>
-      <toc>perl_bugs</toc>
-      <toc>python</toc>
-      <toc>python_bugs</toc>
-      <toc>qt-kdev3</toc>
-      <toc>ruby</toc>
-      <toc>ruby_bugs</toc>
-      <toc>sdl</toc>
-      <toc>stl</toc>
-      <toc>w3c-svg</toc>
-      <toc>sw</toc>
-      <toc>w3c-uaag10</toc>
-      <toc>wxwidgets_bugs</toc>
-    </ignoretocs>
-    <ignoreqt_xml>
-      <toc>Guide to the Qt Translation Tools</toc>
-      <toc>Qt Assistant Manual</toc>
-      <toc>Qt Designer Manual</toc>
-      <toc>Qt Reference Documentation</toc>
-      <toc>qmake User Guide</toc>
-    </ignoreqt_xml>
-    <ignoredoxygen>
-      <toc>KDE Libraries (Doxygen)</toc>
-    </ignoredoxygen>
-  </kdevdoctreeview>
-  <kdevfilecreate>
-    <useglobaltypes>
-      <type ext="c" />
-      <type ext="h" />
-    </useglobaltypes>
-  </kdevfilecreate>
-  <kdevfileview>
-    <groups>
-      <group pattern="*.h" name="Header files" />
-      <group pattern="*.c" name="Source files" />
-      <hidenonprojectfiles>false</hidenonprojectfiles>
-      <hidenonlocation>false</hidenonlocation>
-    </groups>
-    <tree>
-      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
-      <hidenonprojectfiles>false</hidenonprojectfiles>
-      <showvcsfields>false</showvcsfields>
-    </tree>
-  </kdevfileview>
-  <kdevdocumentation>
-    <projectdoc>
-      <docsystem>Doxygen Documentation Collection</docsystem>
-      <docurl>${APPNAMELC}.tag</docurl>
-    </projectdoc>
-  </kdevdocumentation>
-  <substmap>
-    <APPNAME>psLib</APPNAME>
-    <APPNAMELC>pslib</APPNAMELC>
-    <APPNAMEUC>PSLIB</APPNAMEUC>
-    <AUTHOR>Robert Daniel DeSonia</AUTHOR>
-    <CFLAGS/>
-    <EMAIL>robert.desonia@mhpcc.hpc.mil</EMAIL>
-    <LICENSE>GPL</LICENSE>
-    <LICENSEFILE>COPYING</LICENSEFILE>
-    <OPT_INCS>-I/usr/include</OPT_INCS>
-    <OPT_LIBS>-lm</OPT_LIBS>
-    <VERSION>1.5</VERSION>
-    <dest>/home/desonia/pslib</dest>
-  </substmap>
-  <kdevcppsupport>
-    <references/>
-    <codecompletion>
-      <includeGlobalFunctions>true</includeGlobalFunctions>
-      <includeTypes>true</includeTypes>
-      <includeEnums>true</includeEnums>
-      <includeTypedefs>false</includeTypedefs>
-      <automaticCodeCompletion>true</automaticCodeCompletion>
-      <automaticArgumentsHint>true</automaticArgumentsHint>
-      <automaticHeaderCompletion>true</automaticHeaderCompletion>
-      <codeCompletionDelay>250</codeCompletionDelay>
-      <argumentsHintDelay>400</argumentsHintDelay>
-      <headerCompletionDelay>250</headerCompletionDelay>
-    </codecompletion>
-    <creategettersetter>
-      <prefixGet/>
-      <prefixSet>set</prefixSet>
-      <prefixVariable>m_,_</prefixVariable>
-      <parameterName>theValue</parameterName>
-      <inlineGet>true</inlineGet>
-      <inlineSet>true</inlineSet>
-    </creategettersetter>
-  </kdevcppsupport>
-  <cppsupportpart>
-    <filetemplates>
-      <interfacesuffix>.h</interfacesuffix>
-      <implementationsuffix>.cpp</implementationsuffix>
-    </filetemplates>
-  </cppsupportpart>
-  <kdevdebugger>
-    <general>
-      <programargs/>
-      <gdbpath/>
-      <dbgshell>libtool</dbgshell>
-      <configGdbScript/>
-      <runShellScript/>
-      <runGdbScript/>
-      <breakonloadinglibs>true</breakonloadinglibs>
-      <separatetty>false</separatetty>
-      <floatingtoolbar>false</floatingtoolbar>
-    </general>
-    <display>
-      <staticmembers>false</staticmembers>
-      <demanglenames>true</demanglenames>
-      <outputradix>10</outputradix>
-    </display>
-  </kdevdebugger>
-  <kdevcvsservice>
-    <recursivewhenupdate>true</recursivewhenupdate>
-    <prunedirswhenupdate>true</prunedirswhenupdate>
-    <createdirswhenupdate>true</createdirswhenupdate>
-    <recursivewhencommitremove>true</recursivewhencommitremove>
-    <revertoptions>-C</revertoptions>
-  </kdevcvsservice>
-</kdevelop>
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 5082)
+++ /trunk/psLib/src/astro/psTime.c	(revision 5083)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-13 01:09:58 $
+ *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-21 02:11:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1611,2 +1611,88 @@
 }
 
+static psHash *timers = NULL;
+static char timerName[256] = "\0";
+
+static void psTimerFree ()
+{
+
+    psFree (timers);
+    p_psTimeFinalize();
+    return;
+}
+
+// start/restart a named timer
+bool psTimerStart (char *name)
+{
+
+    psTime *start;
+
+    if (timers == NULL) {
+        timers = psHashAlloc (16);
+        //        psMemSetDeallocator(timers, (psFreeFunc)psTimerFree);
+    }
+    strncpy(timerName, name, 256);
+    start = psTimeGetNow (PS_TIME_UTC);
+    psHashAdd (timers, name, start);
+    psFree (start);
+    return (true);
+}
+
+psF64 psTimerClear (char *name)
+{
+    psF64 timerTime = 0.0;
+    bool status;
+
+    if (name == NULL)
+        return false;
+    timerTime = psTimerMark(name);
+    status = psHashRemove (timers, name);
+    strncpy(timerName, "\0", 256);
+    if ( !status )
+        return 0.0;
+    else
+        return timerTime;
+}
+
+// get current elapsed time on named timer
+psF64 psTimerMark (char *name)
+{
+
+    psTime *start;
+    psTime *mark;
+    psF64   delta;
+
+    if (timers == NULL)
+        return (0);
+    start = (psTime*)psHashLookup (timers, name);
+    if (start == NULL)
+        return (0);
+    mark = psTimeGetNow (PS_TIME_UTC);
+    delta = psTimeDelta (mark, start);
+    psFree (mark);
+    // psFree (start); -- XXX is psHashLookup not psMemCopying?
+
+    return (delta);
+}
+
+psF64 psTimerStop(void)
+{
+    psF64 timerTime = 0.0;
+
+    if ( strncmp(timerName, "\0", 256) )
+        timerTime = psTimerMark(timerName);
+    strncpy(timerName, "\0", 2);
+    psTimerFree();
+    return timerTime;
+}
+
+void psTimeInitialize(const char *timeConfig)
+{
+    p_psTimeInit(timeConfig);
+}
+
+void psTimeFinalize(void)
+{
+    p_psTimeFinalize();
+}
+
Index: /trunk/psLib/src/astro/psTime.h
===================================================================
--- /trunk/psLib/src/astro/psTime.h	(revision 5082)
+++ /trunk/psLib/src/astro/psTime.h	(revision 5083)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-13 01:09:58 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-21 02:11:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -82,4 +82,12 @@
 );
 
+/** Initialize time data.
+ *
+ *  Reads the configuration file and sets up the appropriate psTimeTables and predictions.
+ */
+void psTimeInitialize(
+    const char *timeConfig             ///< psTime configuration file
+);
+
 /** Free memory persistant time data.
  *
@@ -89,4 +97,10 @@
  */
 psBool p_psTimeFinalize(void);
+
+/** Frees memory that was allocated by psTime functions.
+ *
+ *  Allows a subsequent search for leaked memory.
+ */
+void psTimeFinalize(void);
 
 /** Allocate time struct.
@@ -369,4 +383,18 @@
 );
 
+bool psTimerStart(
+    char *name
+);
+
+psF64 psTimerClear(
+    char *name
+);
+
+psF64 psTimerMark(
+    char *name
+);
+
+psF64 psTimerStop(void);
+
 /// @}
 
Index: /trunk/psLib/test/astro/tst_psTime_04.c
===================================================================
--- /trunk/psLib/test/astro/tst_psTime_04.c	(revision 5082)
+++ /trunk/psLib/test/astro/tst_psTime_04.c	(revision 5083)
@@ -15,6 +15,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-09-13 01:39:13 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-09-21 02:11:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -32,4 +32,5 @@
 static psS32 testTimeInit5(void);
 static psS32 testTimeInit6(void);
+static psS32 testTimer1(void);
 
 testDescription tests[] = {
@@ -40,4 +41,5 @@
                               {testTimeInit5,000,"p_psTimeInit",0,false},
                               {testTimeInit6,000,"p_psTimeInit",0,false},
+                              {testTimer1,000,"psTimer",0,false},
                               {NULL}
                           };
@@ -105,2 +107,31 @@
 }
 
+psS32 testTimer1(void)
+{
+    psF64 testTime = 0.0;
+    psF64 testTime2 = 0.0;
+    psF64 testTime3 = 0.0;
+
+    if ( !psTimerStart("newTime") ) {
+        printf("TimerStart Failed\n");
+        return 1;
+    }
+    testTime = psTimerMark("newTime");
+    if (testTime == 0.0) {
+        printf("TimerMark Failed\n");
+        return 2;
+    }
+    testTime2 = psTimerClear("newTime");
+    if (testTime2 == 0.0) {
+        printf("TimerClear Failed\n");
+        return 3;
+    }
+    psTimerStart("newTime");
+    testTime3 = psTimerStop();
+    if (testTime3 == 0.0) {
+        printf("TimerStop Failed\n");
+        return 4;
+    }
+    return 0;
+}
+
Index: /trunk/psLib/test/astro/verified/tst_psTime_04.stderr
===================================================================
--- /trunk/psLib/test/astro/verified/tst_psTime_04.stderr	(revision 5082)
+++ /trunk/psLib/test/astro/verified/tst_psTime_04.stderr	(revision 5083)
@@ -73,2 +73,11 @@
 ---> TESTPOINT PASSED (psTime{p_psTimeInit} | tst_psTime_04.c)
 
+/***************************** TESTPOINT ******************************************\
+*             TestFile: tst_psTime_04.c                                            *
+*            TestPoint: psTime{psTimer}                                            *
+*             TestType: Positive                                                   *
+\**********************************************************************************/
+
+
+---> TESTPOINT PASSED (psTime{psTimer} | tst_psTime_04.c)
+
