Skip to content

Commit

Permalink
Add datetime to window title (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Mar 3, 2023
1 parent 6bed3ad commit 9a97bbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "1.5.2"
[deps]
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FlameGraphs = "08572546-2f56-4bcf-ba4e-bab62c3a3f89"
Graphics = "a2bd30eb-e257-5431-a919-1863eab51364"
Expand Down
4 changes: 3 additions & 1 deletion src/ProfileView.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@optle
@eval Base.Experimental.@optlevel 1
end

using Dates
using Profile
using FlameGraphs
using FlameGraphs.IndirectArrays
Expand Down Expand Up @@ -85,13 +86,14 @@ macro profview(ex)
Profile.clear()
# pause the eventloop while profiling
before = Gtk.is_eventloop_running()
dt = Dates.now()
try
Gtk.enable_eventloop(false, wait_stopped = true)
@profile $(esc(ex))
finally
Gtk.enable_eventloop(before, wait_stopped = true)
end
view()
view(;windowname = "Profile - $(Time(round(dt, Second)))")
end
end

Expand Down

0 comments on commit 9a97bbd

Please sign in to comment.