mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
Lib: Remove Stopwatch class
This was a hack used to profile things before we had a proper profiler. Since RDTSC is not available in userspace, this is not useful anymore.
This commit is contained in:
parent
889ecd1375
commit
23e4e03233
1 changed files with 0 additions and 33 deletions
|
@ -3,39 +3,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
struct Stopwatch {
|
|
||||||
union SplitQword {
|
|
||||||
struct {
|
|
||||||
uint32_t lsw;
|
|
||||||
uint32_t msw;
|
|
||||||
};
|
|
||||||
uint64_t qw { 0 };
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
Stopwatch(const char* name)
|
|
||||||
: m_name(name)
|
|
||||||
{
|
|
||||||
read_tsc(&m_start.lsw, &m_start.msw);
|
|
||||||
}
|
|
||||||
|
|
||||||
~Stopwatch()
|
|
||||||
{
|
|
||||||
SplitQword end;
|
|
||||||
read_tsc(&end.lsw, &end.msw);
|
|
||||||
uint64_t diff = end.qw - m_start.qw;
|
|
||||||
dbgprintf("Stopwatch(%s): %Q ticks\n", m_name, diff);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
const char* m_name { nullptr };
|
|
||||||
SplitQword m_start;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
int module_load(const char* path, size_t path_length);
|
int module_load(const char* path, size_t path_length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue