mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibJS: Implement console.time/timeLog/timeEnd() methods
This commit is contained in:
parent
2f3e24d71e
commit
1fba221b46
5 changed files with 152 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
||||
|
@ -78,17 +79,21 @@ public:
|
|||
ThrowCompletionOr<Value> group();
|
||||
ThrowCompletionOr<Value> group_collapsed();
|
||||
ThrowCompletionOr<Value> group_end();
|
||||
ThrowCompletionOr<Value> time();
|
||||
ThrowCompletionOr<Value> time_log();
|
||||
ThrowCompletionOr<Value> time_end();
|
||||
|
||||
void output_debug_message(LogLevel log_level, String output) const;
|
||||
|
||||
private:
|
||||
ThrowCompletionOr<String> value_vector_to_string(Vector<Value>&);
|
||||
ThrowCompletionOr<String> format_time_since(Core::ElapsedTimer timer);
|
||||
|
||||
GlobalObject& m_global_object;
|
||||
ConsoleClient* m_client { nullptr };
|
||||
|
||||
HashMap<String, unsigned> m_counters;
|
||||
|
||||
HashMap<String, Core::ElapsedTimer> m_timer_table;
|
||||
Vector<Group> m_group_stack;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue