File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,9 @@ info = liftEffect <<< EffConsole.info
29
29
30
30
infoShow :: forall m a . MonadEffect m => Show a => a -> m Unit
31
31
infoShow = liftEffect <<< EffConsole .infoShow
32
+
33
+ time :: forall m . MonadEffect m => String -> m Unit
34
+ time = liftEffect <<< EffConsole .time
35
+
36
+ timeEnd :: forall m . MonadEffect m => String -> m Unit
37
+ timeEnd = liftEffect <<< EffConsole .timeEnd
Original file line number Diff line number Diff line change @@ -27,3 +27,17 @@ exports.info = function (s) {
27
27
return { } ;
28
28
} ;
29
29
} ;
30
+
31
+ exports . time = function ( s ) {
32
+ return function ( ) {
33
+ console . time ( s ) ;
34
+ return { } ;
35
+ } ;
36
+ } ;
37
+
38
+ exports . timeEnd = function ( s ) {
39
+ return function ( ) {
40
+ console . timeEnd ( s ) ;
41
+ return { } ;
42
+ } ;
43
+ } ;
Original file line number Diff line number Diff line change @@ -44,3 +44,9 @@ foreign import info
44
44
-- | `String`.
45
45
infoShow :: forall a . Show a => a -> Effect Unit
46
46
infoShow a = info (show a)
47
+
48
+ -- | Start a named timer.
49
+ foreign import time :: String -> Effect Unit
50
+
51
+ -- | Stop a named timer and print time since it started in milliseconds.
52
+ foreign import timeEnd :: String -> Effect Unit
You can’t perform that action at this time.
0 commit comments