aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/compositor
diff options
context:
space:
mode:
authorEduardo Julian2021-06-27 20:09:48 -0400
committerEduardo Julian2021-06-27 20:09:48 -0400
commitdb3e864ae66da7f7d1034ae95967605144d5ec47 (patch)
tree29c51002455a2c8f7d4aa25ab13c688cfa8d60e3 /stdlib/source/program/compositor
parentb80f79ae6b2e240949ebd709a253e21f7caf7ed3 (diff)
Made obtaining env variables more granular + partial Lua support.
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/compositor.lux15
1 files changed, 15 insertions, 0 deletions
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index a6b85ccf0..557e9d22a 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -20,6 +20,8 @@
[collection
["." dictionary]
["." row (#+ Row)]]]
+ [time
+ ["." instant]]
["." world #_
["." file (#+ File Path)]
["#/." program]
@@ -71,6 +73,18 @@
(#try.Success output)
(wrap output))))
+(def: (timed process)
+ (All [a]
+ (-> (Promise (Try a)) (Promise (Try a))))
+ (do promise.monad
+ [#let [start (io.run instant.now)]
+ output process
+ #let [_ ("lux io log" (|> (io.run instant.now)
+ (instant.span start)
+ %.duration
+ (format "Duration: ")))]]
+ (wrap output)))
+
(def: (package! monad file_system [packager package] static archive context)
(All [!] (-> (Monad !) (file.System !) [Packager Path] Static Archive Context (! (Try Any))))
(for {@.old
@@ -132,6 +146,7 @@
(case service
(#/cli.Compilation compilation)
(<| (or_crash! "Compilation failed:")
+ ..timed
(do (try.with promise.monad)
[#let [[compilation_sources compilation_libraries compilation_target compilation_module] compilation]
import (/import.import (get@ #platform.&file_system platform) compilation_libraries)