diff options
| -rw-r--r-- | doc/lua-filters.md | 10 | ||||
| -rw-r--r-- | pandoc-lua-engine/pandoc-lua-engine.cabal | 2 | ||||
| -rw-r--r-- | pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs | 7 | ||||
| -rw-r--r-- | stack.yaml | 1 |
4 files changed, 17 insertions, 3 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md index 4309f5cf1..efaeb6343 100644 --- a/doc/lua-filters.md +++ b/doc/lua-filters.md @@ -4890,6 +4890,16 @@ The operating system on which the program is running. ## Functions +### cputime {#pandoc.system.cputime} + +`cputime ()` + +Returns the number of picoseconds CPU time used by the current +program. The precision of this result may vary in different +versions and on different platforms. + +*Since*: 3.1.1 + ### environment {#pandoc.system.environment} `environment ()` diff --git a/pandoc-lua-engine/pandoc-lua-engine.cabal b/pandoc-lua-engine/pandoc-lua-engine.cabal index dcc98265f..cbc245095 100644 --- a/pandoc-lua-engine/pandoc-lua-engine.cabal +++ b/pandoc-lua-engine/pandoc-lua-engine.cabal @@ -109,7 +109,7 @@ library , hslua-core >= 2.2.1 && < 2.3 , hslua-module-doclayout>= 1.0.4 && < 1.1 , hslua-module-path >= 1.0.3 && < 1.1 - , hslua-module-system >= 1.0 && < 1.1 + , hslua-module-system >= 1.0.3 && < 1.1 , hslua-module-text >= 1.0.3 && < 1.1 , hslua-module-version >= 1.0.3 && < 1.1 , hslua-module-zip >= 1.0.0 && < 1.1 diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs index 0f32bdaa8..61ab949a8 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/System.hs @@ -14,9 +14,11 @@ module Text.Pandoc.Lua.Module.System ( documentedModule ) where +import Data.Version (makeVersion) import HsLua import HsLua.Module.System - (arch, env, getwd, ls, mkdir, os, rmdir, with_env, with_tmpdir, with_wd) + ( arch, cputime, env, getwd, ls, mkdir, os, rmdir + , with_env, with_tmpdir, with_wd) -- | Push the pandoc.system module on the Lua stack. documentedModule :: LuaError e => Module e @@ -28,7 +30,8 @@ documentedModule = Module , os ] , moduleFunctions = - [ setName "environment" env + [ cputime `since` makeVersion [3, 1, 1] + , setName "environment" env , setName "get_working_directory" getwd , setName "list_directory" ls , setName "make_directory" mkdir diff --git a/stack.yaml b/stack.yaml index 8c8f39a7c..593752d31 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,6 +12,7 @@ extra-deps: - gridtables-0.1.0.0 - hslua-cli-1.2.0 - hslua-list-1.1.0.1 +- hslua-module-system-1.0.3 - hslua-module-zip-1.0.0 - jira-wiki-markup-1.5.0 - mime-types-0.1.1.0 |
