# Clock.cc

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2002-2005  ONERA
    00004 //
    00005 // This program is free software ; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public License
    00007 // as published by the Free Software Foundation ; either version 2 of
    00008 // the License, or (at your option) any later version.
    00009 //
    00010 // This program is distributed in the hope that it will be useful, but
    00011 // WITHOUT ANY WARRANTY ; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this program ; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    00018 // ----------------------------------------------------------------------------
    00019
    00020 #include "Clock.hh"
    00021 namespace certi {
    00022
    00023 Clock::Clock(const std::string newName)
    00024 {
    00025     name = newName;
    00026 }
    00027
    00028 uint64_t
    00029 Clock::getDeltaTicks(const uint64_t previousTicks) {
    00030    return (getCurrentTicksValue()-previousTicks);
    00031 }
    00032
    00033 double  Clock::getDeltaNanoSecond(const uint64_t firstTicks, const uint64_t secondTicks) {
    00034     return tick2NanoSecond(secondTicks-firstTicks);
    00035 }
    00036
    00037 double
    00038 Clock::getDeltaNanoSecond(const uint64_t previousTicks) {
    00039     return tick2NanoSecond(getDeltaTicks(previousTicks));
    00040 }
    00041
    00042
    00043 Clock::~Clock()
    00044 {
    00045 }
    00046
    00047 }