#include <assert.h>
#include <math.h>
#include <stdio.h>
#include "nvim/func_attr.h"
#include "nvim/globals.h"
#include "nvim/os/os_defs.h"
#include "nvim/os/time.h"
#include "nvim/profile.h"
proftime_T profile_add | ( | proftime_T | tm1, |
proftime_T | tm2 | ||
) |
Adds time tm2
to tm1
.
tm1
+ tm2
int profile_cmp | ( | proftime_T | tm1, |
proftime_T | tm2 | ||
) |
Compares profiling times.
Times tm1
and tm2
must be less than 150 years apart.
tm2
< tm1
0: tm2
== tm1
>0: tm2
> tm1
proftime_T profile_divide | ( | proftime_T | tm, |
int | count | ||
) |
Divides time tm
by count
.
proftime_T profile_end | ( | proftime_T | tm | ) |
Computes the time elapsed.
tm
until now. bool profile_equal | ( | proftime_T | tm1, |
proftime_T | tm2 | ||
) |
Checks if time tm1
is equal to tm2
.
tm1
== tm2
proftime_T profile_get_wait | ( | void | ) |
Gets the current waittime.
const char* profile_msg | ( | proftime_T | tm | ) |
Gets a string representing time tm
.
tm | Time |
tm
in the form "seconds.microseconds". bool profile_passed_limit | ( | proftime_T | tm | ) |
Checks if current time has passed tm
.
tm
, false if not or if the timer was not set. proftime_T profile_self | ( | proftime_T | self, |
proftime_T | total, | ||
proftime_T | children | ||
) |
Adds the self
time from the total time and the children
time.
total
<= children
, then self, otherwise self
+ total
- children
void profile_set_wait | ( | proftime_T | wait | ) |
Sets the current waittime.
proftime_T profile_setlimit | ( | int64_t | msec | ) |
Gets the time msec
into the future.
msec | milliseconds, the maximum number of milliseconds is (2^63 / 10^6) - 1 = 9.223372e+12. |
int64_t profile_signed | ( | proftime_T | tm | ) |
Converts time duration tm
(profile_sub
result) to a signed integer.
proftime_T profile_start | ( | void | ) |
Gets the current time.
proftime_T profile_sub | ( | proftime_T | tm1, |
proftime_T | tm2 | ||
) |
Subtracts time tm2
from tm1
.
Unsigned overflow (wraparound) occurs if tm2
is greater than tm1
. Use profile_signed()
to get the signed integer value.
tm1
- tm2
proftime_T profile_sub_wait | ( | proftime_T | tm, |
proftime_T | tma | ||
) |
Subtracts the passed waittime since tm
.
tma
- (waittime - tm
) proftime_T profile_zero | ( | void | ) |
Gets the zero time.
void time_msg | ( | const char * | mesg, |
const proftime_T * | start | ||
) |
Prints out timing info.
time_start()
once before calling this.mesg | the message to display next to the timing information |
start | only for do_source: start time |
void time_pop | ( | proftime_T | tp | ) |
Computes the prev time after doing something that could nest.
Subtracts tp
from the static global g_prev_time
.
tp | the time to subtract |
void time_push | ( | proftime_T * | rel, |
proftime_T * | start | ||
) |
Saves the previous time before doing something that could nest.
After calling this function, the static global g_prev_time
will contain the current time.
[out] | rel | to the time elapsed so far |
[out] | start | the current time |
void time_start | ( | const char * | message | ) |
Initializes the startuptime code.
Must be called once before calling other startuptime code (such as time_{push,pop,msg,...}).
message | the message that will be displayed |