1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-11 13:06:59 +03:00
This commit is contained in:
Rui Ueyama 2021-01-24 13:26:03 +09:00
parent f645a9deb1
commit ec2a2079b5
2 changed files with 8 additions and 8 deletions

8
mold.h
View File

@ -1031,10 +1031,10 @@ struct TimerRecord {
void stop();
std::string name;
u64 start;
u64 end;
u64 user;
u64 sys;
i64 start;
i64 end;
i64 user;
i64 sys;
bool stopped = false;
};

View File

@ -16,14 +16,14 @@ void Counter::print() {
std::cout << std::setw(20) << std::right << c->name << "=" << c->value << "\n";
}
static u64 now_nsec() {
static i64 now_nsec() {
struct timespec t;
clock_gettime(CLOCK_MONOTONIC, &t);
return (u64)t.tv_sec * 1000000000 + t.tv_nsec;
return (i64)t.tv_sec * 1000000000 + t.tv_nsec;
}
static u64 to_nsec(struct timeval t) {
return (u64)t.tv_sec * 1000000000 + t.tv_usec * 1000;
static i64 to_nsec(struct timeval t) {
return (i64)t.tv_sec * 1000000000 + t.tv_usec * 1000;
}
TimerRecord::TimerRecord(std::string name) : name(name) {