Restart on crash

This commit is contained in:
o9000
2016-01-03 18:03:36 +01:00
parent 69f6f65db6
commit cd863c2819
6 changed files with 194 additions and 11 deletions

View File

@@ -435,11 +435,16 @@ void stop_multi_timeout(timeout *t)
double profiling_get_time_old_time = 0;
double profiling_get_time()
double get_time()
{
struct timespec cur_time;
clock_gettime(CLOCK_MONOTONIC, &cur_time);
double t = cur_time.tv_sec + cur_time.tv_nsec * 1.0e-9;
return cur_time.tv_sec + cur_time.tv_nsec * 1.0e-9;
}
double profiling_get_time()
{
double t = get_time();
if (profiling_get_time_old_time == 0)
profiling_get_time_old_time = t;
double delta = t - profiling_get_time_old_time;