mirror of
https://github.com/rui314/mold.git
synced 2024-09-11 13:06:59 +03:00
wip
This commit is contained in:
parent
f645a9deb1
commit
ec2a2079b5
8
mold.h
8
mold.h
@ -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;
|
||||
};
|
||||
|
||||
|
8
perf.cc
8
perf.cc
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user