#include "botan-1.6/include/timers.h"
#include "botan-1.6/include/libstate.h"
#include "botan-1.6/include/util.h"
#include <ctime>
namespace Enctain {
namespace Botan {
u64bit system_time()
{
return static_cast<u64bit>(std::time(0));
}
u64bit system_clock()
{
return global_state().system_clock();
}
u64bit Timer::clock() const
{
return combine_timers(std::time(0), std::clock(), CLOCKS_PER_SEC);
}
u64bit combine_timers(u32bit seconds, u32bit parts, u32bit parts_hz)
{
const u64bit NANOSECONDS_UNITS = 1000000000;
parts *= (NANOSECONDS_UNITS / parts_hz);
return ((seconds * NANOSECONDS_UNITS) + parts);
}
}
}