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
2929
3030infoShow :: forall m a . MonadEffect m => Show a => a -> m Unit
3131infoShow = 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) {
2727 return { } ;
2828 } ;
2929} ;
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
4444-- | `String`.
4545infoShow :: forall a . Show a => a -> Effect Unit
4646infoShow 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