/*------------------------------------------------------------------------------
 src/lib/dj/djTime.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#ifndef DJ_TIME_H
#define DJ_TIME_H
#include <djStr.h>
#include <sys/time.h>

namespace dj {

// Timer.
//
class Timer {
public:

  Timer();
  
  // Set.
  //
  void start();
  void check();
  
  // Get.
  //
  timeval elapsed() const;
  double seconds() const;
  double fps() const;

private:

  timeval _t0, _t1;
};

// Functions.
//
time_t timeCurrent();

// Conversion.
//
const Str timeToStr(time_t);

}

#include <djTime_.h>
#endif
