summaryrefslogtreecommitdiff
path: root/tex/context/base/core-uti.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-02-08 10:06:00 +0100
committerHans Hagen <pragma@wxs.nl>2011-02-08 10:06:00 +0100
commit13fe57ae547e79f911229fe4586591f7a8439c69 (patch)
treee30b07f26511067cd49a3cc0333720a75f157076 /tex/context/base/core-uti.lua
parent6f1048d50cb4376e5bf17c8c9221f61e4af9f778 (diff)
downloadcontext-13fe57ae547e79f911229fe4586591f7a8439c69.tar.gz
beta 2011.02.08 10:06
Diffstat (limited to 'tex/context/base/core-uti.lua')
-rw-r--r--tex/context/base/core-uti.lua24
1 files changed, 16 insertions, 8 deletions
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua
index 88afb35a9..f302d6051 100644
--- a/tex/context/base/core-uti.lua
+++ b/tex/context/base/core-uti.lua
@@ -78,20 +78,22 @@ if not checksums.new then checksums.new = md5.HEX("new") end -- used in experime
job.register('job.variables.checksums', checksums)
+local rmethod, rvalue
+
local function initializer()
tobesaved = mark(jobvariables.tobesaved)
collected = mark(jobvariables.collected)
checksums = mark(jobvariables.checksums)
- local r = collected.randomseed
- if not r then
- r = math.random()
- math.setrandomseedi(r,"initialize")
- report_jobcontrol("initializing randomizer with %s",r)
+ rvalue = collected.randomseed
+ if not rvalue then
+ rvalue = math.random()
+ math.setrandomseedi(rvalue,"initialize")
+ rmethod = "initialized"
else
- math.setrandomseedi(r,"previous run")
- report_jobcontrol("resuming randomizer with %s",r)
+ math.setrandomseedi(rvalue,"previous run")
+ rmethod = "resumed"
end
- tobesaved.randomseed = r
+ tobesaved.randomseed = rvalue
for cs, value in next, collected do
context.setxvalue(cs,value)
end
@@ -199,6 +201,12 @@ statistics.register("callbacks", function()
end
end)
+statistics.register("randomizer", function()
+ if rmethod and rvalue then
+ return format("%s with value %s",rmethod,rvalue)
+ end
+end)
+
function statistics.formatruntime(runtime)
local shipped = tex.count['nofshipouts']
local pages = tex.count['realpageno'] - 1