Dear Mike,

Thanks for your email.

Every SVG element must have a unique name.

Time::HiRes is used in PGgraphmacros.pl in the
   &plot_functions   subroutine 
in conjunction with a  $counter  field
to insure that every function has a unique name.

The  $start_time = Time::HiRes::time()  field
distinguishes between different invocations
of   &plot_functions  (within the same problem).

The  $counter  field distinguishes between
different functions within a single invocation
of  &plot_functions.

Using just the time() function might be insufficient, 
because it's readily possible for two 
invocations of &plot_functions to
be processed in the same second.

Ideally, a problem author would assign
different names to different functions.

But since the SVG package has to be able to handle
existing problems without their being changed,
it's necessary to have the &plot_functions subroutine
insure that functions have unique names.

To track this in PGgraphmacros.pl, search
for the variables  $start_time  and  $counter.

In the documentation for GD::SVG, the author
discusses how he had to deal with this issue.
My memory is vague, but I think he may have indicated
that he resorted to a random number generator,
although I may be remembering something from
some other documentation concerning SVG graphics.

If you don't like this use of Time::HiRes,
one could use some other method for insuring
uniqueness.


Sincerely,

Bill

--------------------------------------------------------------------------------



On Sat, 6 Jul 2013, Michael Gage wrote:

> 
> In conf/defaults.config:
> 
> > @@ -1021,6 +1043,7 @@ ${pg}{modules} = [
> >  	[qw(Locale::Maketext)],
> >  	[qw(WeBWorK::Localize)],
> >  	[qw(JSON)],
> > +	[qw(Time::HiRes)],
> 
> Where is this being used inside the PG safe compartment?
> 
> —
> Reply to this email directly or view it on GitHub.[PqzSY_pa-H604IjFOkLjSk2ksj3RZA74c4JVKbjfgNF45pcsLc5dl3bbJIwFYFBo.gif]
> 
> 
>