\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 $<$time.h$>$}\par
{\tt \#include $<$IPBS/TSS.h$>$}\par
{\tt \#include $<$IPBS/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\_\-\_\-utb\_\-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}~1000000000ll}
\label{TSS_8c_a87c974005a7a48c8abf0f5174a29adc}

\begin{CompactList}\small\item\em Convenience symbol for a billion. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
struct timespec \hyperlink{TSS_8c_29dfb67e572ecefd8e7a8d08e58a3aa1}{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 
struct timespec \hyperlink{TSS_8c_953fbda085a34872d2faa9f8a4ee6896}{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 
struct timespec \hyperlink{TSS_8c_9beaa96c0a2f95cbce1e77e3190c05cc}{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 
struct timespec \hyperlink{TSS_8c_290fdccc9b6d459dd1fd08e8d4570db8}{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 
struct timespec \hyperlink{TSS_8c_3948b341b3ede81c8de4892f6e00c51d}{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.2 2011/03/25 21:14:42 saxton 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_3948b341b3ede81c8de4892f6e00c51d}{
\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}struct timespec TSS\_\-from\_\-wct ({\bf WCT\_\-time} {\em wct})\hspace{0.3cm}{\tt  \mbox{[}read\mbox{]}}}}
\label{TSS_8c_3948b341b3ede81c8de4892f6e00c51d}


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_953fbda085a34872d2faa9f8a4ee6896}{
\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}struct timespec TSS\_\-nsecsTOtodAdd (unsigned int {\em delta})\hspace{0.3cm}{\tt  \mbox{[}read\mbox{]}}}}
\label{TSS_8c_953fbda085a34872d2faa9f8a4ee6896}


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_29dfb67e572ecefd8e7a8d08e58a3aa1}{
\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}struct timespec TSS\_\-nsecxTOtodAdd (long long int {\em delta})\hspace{0.3cm}{\tt  \mbox{[}read\mbox{]}}}}
\label{TSS_8c_29dfb67e572ecefd8e7a8d08e58a3aa1}


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_290fdccc9b6d459dd1fd08e8d4570db8}{
\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}struct timespec TSS\_\-secsTOtodAdd (unsigned int {\em delta})\hspace{0.3cm}{\tt  \mbox{[}read\mbox{]}}}}
\label{TSS_8c_290fdccc9b6d459dd1fd08e8d4570db8}


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_9beaa96c0a2f95cbce1e77e3190c05cc}{
\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}struct timespec TSS\_\-usecsTOtodAdd (unsigned int {\em delta})\hspace{0.3cm}{\tt  \mbox{[}read\mbox{]}}}}
\label{TSS_8c_9beaa96c0a2f95cbce1e77e3190c05cc}


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().