time.cc (10531:fe837de10255) time.cc (10905:a6ca6831e775)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 103 unchanged lines hidden (view full) ---

112 if (secs < 10.0 && !str.str().empty())
113 str << '0';
114 str << secs;
115
116 return str.str();
117}
118
119void
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 103 unchanged lines hidden (view full) ---

112 if (secs < 10.0 && !str.str().empty())
113 str << '0';
114 str << secs;
115
116 return str.str();
117}
118
119void
120Time::serialize(const std::string &base, ostream &os)
120Time::serialize(const std::string &base, CheckpointOut &cp) const
121{
121{
122 paramOut(os, base + ".sec", sec());
123 paramOut(os, base + ".nsec", nsec());
122 paramOut(cp, base + ".sec", sec());
123 paramOut(cp, base + ".nsec", nsec());
124}
125
126void
124}
125
126void
127Time::unserialize(const std::string &base, Checkpoint *cp,
128 const string &section)
127Time::unserialize(const std::string &base, CheckpointIn &cp)
129{
130 time_t secs;
131 time_t nsecs;
128{
129 time_t secs;
130 time_t nsecs;
132 paramIn(cp, section, base + ".sec", secs);
133 paramIn(cp, section, base + ".nsec", nsecs);
131 paramIn(cp, base + ".sec", secs);
132 paramIn(cp, base + ".nsec", nsecs);
134 sec(secs);
135 nsec(nsecs);
136}
137
138void
139sleep(const Time &time)
140{
141 timespec ts = time;

--- 40 unchanged lines hidden ---
133 sec(secs);
134 nsec(nsecs);
135}
136
137void
138sleep(const Time &time)
139{
140 timespec ts = time;

--- 40 unchanged lines hidden ---