source: golgotha/src/i4/time/mactime.cc @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.4 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#include "time/time.hh"
10#include <Timer.h>
11
12i4_time_class::i4_time_class()
13//{{{
14{
15  Microseconds((UnsignedWide*)private_data);
16}
17//}}}
18
19
20i4_bool i4_time_class::operator <(const i4_time_class &other) const
21//{{{
22{
23  w32 *me_t=(w32 *)private_data;
24  w32 *other_t=(w32 *)other.private_data;
25  return (other_t[0]<me_t[0] || (other_t[0]==me_t[0] &&  other_t[1]<me_t[1]));
26}
27//}}}
28
29
30i4_bool i4_time_class::operator >(const i4_time_class &other) const
31//{{{
32{
33  w32 *me_t=(w32 *)private_data;
34  w32 *other_t=(w32 *)other.private_data;
35  return (other_t[0]>me_t[0] || (other_t[0]==me_t[0] &&  other_t[1]>me_t[1]));
36}
37//}}}
38
39
40sw32 i4_time_class::milli_diff(const i4_time_class &past_time) const
41//{{{
42{
43  w32 *me_t=(w32 *)private_data;
44  w32 *past_t=(w32 *)past_time.private_data;
45
46  return ((sw32)me_t[1]-(sw32)past_t[1])/1000+(me_t[0]-past_t[0])*1000;
47}
48//}}}
49
50
51//{{{ Emacs Locals
52// Local Variables:
53// folded-file: t
54// End:
55//}}}
Note: See TracBrowser for help on using the repository browser.