#ifndef H_CORAL_TIMEDEBUG
#define H_CORAL_TIMEDEBUG
// This file is part of the Coral project.
// Please read the copyright notice in the LICENSE file.

#include <coral/coral.h>
#include <sys/time.h>
#include <string>
#include <ostream>

NAMESPACE_BEGIN(coral);
class timedebug {
 private:
	std::ostream& m_out;
	struct timeval m_start;
	struct timeval m_previous;
	std::string m_name;
	void mark2(const std::string& comment,
		   const struct timeval& past,
		   const struct timeval& now);
 public:
	timedebug(std::ostream& out, const std::string& name);
	void mark(const std::string& comment);
	~timedebug();
};

NAMESPACE_END();
#endif
