summaryrefslogtreecommitdiff
path: root/tex/context/base/core-uti.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-02-08 12:00:13 +0200
committerMarius <mariausol@gmail.com>2011-02-08 12:00:13 +0200
commit9c6992a3436a0db6a01790b29d7c0c3c65460f94 (patch)
treec384372b23cfb6a5379641b4857bae07057bb3be /tex/context/base/core-uti.lua
parent801c806a2489c5c96578fe95945bef589329c4e0 (diff)
downloadcontext-9c6992a3436a0db6a01790b29d7c0c3c65460f94.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