From 915c4a5eb20a25f20f1bf0896126f58f2b4ee338 Mon Sep 17 00:00:00 2001 From: Eduardo Cueto Mendoza Date: Thu, 30 Jul 2020 15:09:03 -0600 Subject: [PATCH] Added example of wwaiting with while --- laptoppower.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/laptoppower.jl b/laptoppower.jl index ab0492c..6577dc9 100644 --- a/laptoppower.jl +++ b/laptoppower.jl @@ -62,3 +62,14 @@ usedram = parse(Float32,ram[3]) totalram = parse(Float32,ram[2]) println("The amount of power draw of the RAM is ram $(((usedram*1.575)/totalram)*1.904) Watts.") + +currenttime = Dates.Time(Dates.now()) +firstrun = 1 +while (Dates.Time(Dates.now()) - currenttime).value / 1000000000.0 < 60.0 + if firstrun == 1 + asyresult = run(cpuusage,wait = false) + #println("I entered here once......") + #println((Dates.Time(Dates.now()) - currenttime).value / 1000000000.0) + end + firstrun += 1 +end