\hypertarget{TSS_8c}{
\section{TSS.c File Reference}
\label{TSS_8c}\index{TSS.c@{TSS.c}}
}
Implements routines that manipulate a timespec structure.  


{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$PBS/TOV.h$>$}\par
{\tt \#include $<$PBS/TSS.h$>$}\par
{\tt \#include $<$PBS/WCT.h$>$}\par
{\tt \#include $<$WCT\_\-pvtdefs.ih$>$}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{TSS_8c_11c6bc89fc8d9d5629a3ccd9cdc7242f}{
\#define \hyperlink{TSS_8c_11c6bc89fc8d9d5629a3ccd9cdc7242f}{get\_\-time}()~WCT\_\-get()}
\label{TSS_8c_11c6bc89fc8d9d5629a3ccd9cdc7242f}

\begin{CompactList}\small\item\em Gets the time in the local representation. \item\end{CompactList}\item 
\hypertarget{TSS_8c_a87c974005a7a48c8abf0f5174a29adc}{
\#define \hyperlink{TSS_8c_a87c974005a7a48c8abf0f5174a29adc}{NSECS\_\-IN\_\-A\_\-SECOND}~(1000 $\ast$ 1000 $\ast$ 1000)}
\label{TSS_8c_a87c974005a7a48c8abf0f5174a29adc}

\begin{CompactList}\small\item\em Convenience symbol for a billion. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
TSS\_\-timespec \hyperlink{TSS_8c_e447e1059d382330e0ed4c50448cfcb7}{TSS\_\-nsecxTOtodAdd} (long long int delta)
\begin{CompactList}\small\item\em Computes the time specification by adding a number of nanoseconds to the current time. \item\end{CompactList}\item 
TSS\_\-timespec \hyperlink{TSS_8c_0e02e957b11bb77e1a7effefc64190e6}{TSS\_\-nsecsTOtodAdd} (unsigned int delta)
\begin{CompactList}\small\item\em Computes the time specification by adding a number of nanoseconds to the current time. \item\end{CompactList}\item 
TSS\_\-timespec \hyperlink{TSS_8c_f60d25c4e15c4c4b6c3d9247f12ab69b}{TSS\_\-usecsTOtodAdd} (unsigned int delta)
\begin{CompactList}\small\item\em Computes the time specification by adding a number of microseconds to the current time. \item\end{CompactList}\item 
TSS\_\-timespec \hyperlink{TSS_8c_4cbedc51881f63375ea00fcfe8e9d637}{TSS\_\-secsTOtodAdd} (unsigned int delta)
\begin{CompactList}\small\item\em Computes the time specification by adding a number of seconds to the current time. \item\end{CompactList}\item 
TSS\_\-timespec \hyperlink{TSS_8c_2e99656868c282cf5c1073fa2fa9ec76}{TSS\_\-from\_\-wct} (\hyperlink{WCT_8h_99ebc88268e494e2e0ee882677d8cc88}{WCT\_\-time} wct)
\begin{CompactList}\small\item\em Converts a Wall Clock Time to a struct timespec. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Implements routines that manipulate a timespec structure. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}

   CVS $Id: TSS.c,v 1.6 2011/03/24 23:05:46 apw Exp $
\end{verbatim}
\normalsize


A timespec structure is a standard structure found in the \char`\"{}C\char`\"{}/Unix world. It represents time as two fields in a structure, a seconds field and a microseconds field. Performing simple operations, such as addition and subtraction, is not completely trivial, so this file provides a set of standard manipulation routines. 

\subsection{Function Documentation}
\hypertarget{TSS_8c_2e99656868c282cf5c1073fa2fa9ec76}{
\index{TSS.c@{TSS.c}!TSS\_\-from\_\-wct@{TSS\_\-from\_\-wct}}
\index{TSS\_\-from\_\-wct@{TSS\_\-from\_\-wct}!TSS.c@{TSS.c}}
\subsubsection[{TSS\_\-from\_\-wct}]{\setlength{\rightskip}{0pt plus 5cm}TSS\_\-timespec TSS\_\-from\_\-wct ({\bf WCT\_\-time} {\em wct})}}
\label{TSS_8c_2e99656868c282cf5c1073fa2fa9ec76}


Converts a Wall Clock Time to a struct timespec. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em wct}]The Wall Clock Time to convert \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The TimeOut Value \end{Desc}


References NSECS\_\-IN\_\-A\_\-SECOND.

Referenced by TOV\_\-from\_\-wct().\hypertarget{TSS_8c_0e02e957b11bb77e1a7effefc64190e6}{
\index{TSS.c@{TSS.c}!TSS\_\-nsecsTOtodAdd@{TSS\_\-nsecsTOtodAdd}}
\index{TSS\_\-nsecsTOtodAdd@{TSS\_\-nsecsTOtodAdd}!TSS.c@{TSS.c}}
\subsubsection[{TSS\_\-nsecsTOtodAdd}]{\setlength{\rightskip}{0pt plus 5cm}TSS\_\-timespec TSS\_\-nsecsTOtodAdd (unsigned int {\em delta})}}
\label{TSS_8c_0e02e957b11bb77e1a7effefc64190e6}


Computes the time specification by adding a number of nanoseconds to the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delta}]The number of microeconds to add to the current time. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]new time returned as a timespec structure. \end{description}
\end{Desc}


References get\_\-time, and NSECS\_\-IN\_\-A\_\-SECOND.

Referenced by TOV\_\-from\_\-nsecs().\hypertarget{TSS_8c_e447e1059d382330e0ed4c50448cfcb7}{
\index{TSS.c@{TSS.c}!TSS\_\-nsecxTOtodAdd@{TSS\_\-nsecxTOtodAdd}}
\index{TSS\_\-nsecxTOtodAdd@{TSS\_\-nsecxTOtodAdd}!TSS.c@{TSS.c}}
\subsubsection[{TSS\_\-nsecxTOtodAdd}]{\setlength{\rightskip}{0pt plus 5cm}TSS\_\-timespec TSS\_\-nsecxTOtodAdd (long long int {\em delta})}}
\label{TSS_8c_e447e1059d382330e0ed4c50448cfcb7}


Computes the time specification by adding a number of nanoseconds to the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delta}]The number of microeconds to add to the current time. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]new time returned as a timespec structure. \end{description}
\end{Desc}


References get\_\-time, and NSECS\_\-IN\_\-A\_\-SECOND.

Referenced by TOV\_\-from\_\-nsecx().\hypertarget{TSS_8c_4cbedc51881f63375ea00fcfe8e9d637}{
\index{TSS.c@{TSS.c}!TSS\_\-secsTOtodAdd@{TSS\_\-secsTOtodAdd}}
\index{TSS\_\-secsTOtodAdd@{TSS\_\-secsTOtodAdd}!TSS.c@{TSS.c}}
\subsubsection[{TSS\_\-secsTOtodAdd}]{\setlength{\rightskip}{0pt plus 5cm}TSS\_\-timespec TSS\_\-secsTOtodAdd (unsigned int {\em delta})}}
\label{TSS_8c_4cbedc51881f63375ea00fcfe8e9d637}


Computes the time specification by adding a number of seconds to the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delta}]The number of seconds to add to the current time. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]new time returned as a timespec structure. \end{description}
\end{Desc}


References get\_\-time, and NSECS\_\-IN\_\-A\_\-SECOND.

Referenced by TOV\_\-from\_\-secs().\hypertarget{TSS_8c_f60d25c4e15c4c4b6c3d9247f12ab69b}{
\index{TSS.c@{TSS.c}!TSS\_\-usecsTOtodAdd@{TSS\_\-usecsTOtodAdd}}
\index{TSS\_\-usecsTOtodAdd@{TSS\_\-usecsTOtodAdd}!TSS.c@{TSS.c}}
\subsubsection[{TSS\_\-usecsTOtodAdd}]{\setlength{\rightskip}{0pt plus 5cm}TSS\_\-timespec TSS\_\-usecsTOtodAdd (unsigned int {\em delta})}}
\label{TSS_8c_f60d25c4e15c4c4b6c3d9247f12ab69b}


Computes the time specification by adding a number of microseconds to the current time. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em delta}]The number of microeconds to add to the current time. \end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em The}]new time returned as a timespec structure. \end{description}
\end{Desc}


References get\_\-time, and NSECS\_\-IN\_\-A\_\-SECOND.

Referenced by TOV\_\-from\_\-usecs().