{
    "content": [
        {
            "type": "text",
            "text": "# Log::Log4perl::Util::TimeTracker (perldoc)\n\n## NAME\n\nLog::Log4perl::Util::TimeTracker - Track time elapsed\n\n## SYNOPSIS\n\nuse Log::Log4perl::Util::TimeTracker;\nmy $timer = Log::Log4perl::Util::TimeTracker->new();\n# equivalent to Time::HiRes::gettimeofday(), regardless\n# if Time::HiRes is present or not.\nmy($seconds, $microseconds) = $timer->gettimeofday();\n# reset internal timer\n$timer->reset();\n# return milliseconds since last reset\n$msecs = $timer->milliseconds();\n# return milliseconds since last call\n$msecs = $timer->deltamilliseconds();\n\n## DESCRIPTION\n\nThis utility module helps tracking time elapsed for PatternLayout's date and time placeholders.\nIts accuracy depends on the availability of the Time::HiRes module. If it's available, its\ngranularity is milliseconds, if not, seconds.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **LICENSE**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Log::Log4perl::Util::TimeTracker",
        "section": "",
        "mode": "perldoc",
        "summary": "Log::Log4perl::Util::TimeTracker - Track time elapsed",
        "synopsis": "use Log::Log4perl::Util::TimeTracker;\nmy $timer = Log::Log4perl::Util::TimeTracker->new();\n# equivalent to Time::HiRes::gettimeofday(), regardless\n# if Time::HiRes is present or not.\nmy($seconds, $microseconds) = $timer->gettimeofday();\n# reset internal timer\n$timer->reset();\n# return milliseconds since last reset\n$msecs = $timer->milliseconds();\n# return milliseconds since last call\n$msecs = $timer->deltamilliseconds();",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 28,
                "subsections": [
                    {
                        "name": "delta_milliseconds",
                        "lines": 25
                    }
                ]
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 17,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Log::Log4perl::Util::TimeTracker - Track time elapsed\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Log::Log4perl::Util::TimeTracker;\n\nmy $timer = Log::Log4perl::Util::TimeTracker->new();\n\n# equivalent to Time::HiRes::gettimeofday(), regardless\n# if Time::HiRes is present or not.\nmy($seconds, $microseconds) = $timer->gettimeofday();\n\n# reset internal timer\n$timer->reset();\n\n# return milliseconds since last reset\n$msecs = $timer->milliseconds();\n\n# return milliseconds since last call\n$msecs = $timer->deltamilliseconds();\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This utility module helps tracking time elapsed for PatternLayout's date and time placeholders.\nIts accuracy depends on the availability of the Time::HiRes module. If it's available, its\ngranularity is milliseconds, if not, seconds.\n\nThe most common use of this module is calling the gettimeofday() method:\n\nmy($seconds, $microseconds) = $timer->gettimeofday();\n\nIt returns seconds and microseconds of the current epoch time. If Time::HiRes is installed, it\nwill simply defer to its gettimeofday() function, if it's missing, time() will be called instead\nand $microseconds will always be 0.\n\nTo measure time elapsed in milliseconds, use the reset() method to reset the timer to the\ncurrent time, followed by one or more calls to the milliseconds() method:\n\n# reset internal timer\n$timer->reset();\n\n# return milliseconds since last reset\n$msecs = $timer->milliseconds();\n\nOn top of the time span between the last reset and the current time, the module keeps track of\nthe time between calls to deltamilliseconds():\n\n$msecs = $timer->deltamilliseconds();\n\nOn the first call, this will return the number of milliseconds since the last reset(), on\nsubsequent calls, it will return the time elapsed in milliseconds since the last call to",
                "subsections": [
                    {
                        "name": "delta_milliseconds",
                        "content": "The internal timer of this module gets its time input from the POSIX time() function, or, if the\nTime::HiRes module is available, from its gettimeofday() function. To figure out which one it\nis, use\n\nif( $timer->hiresavailable() ) {\nprint \"Hooray, we get real milliseconds!\\n\";\n} else {\nprint \"Milliseconds are just bogus\\n\";\n}\n\nFor testing purposes, a different time source can be provided, so test suites can simulate time\npassing by without actually having to wait:\n\nmy $starttime = time();\n\nmy $timer = Log::Log4perl::Util::TimeTracker->new(\ntimefunction => sub {\nreturn $starttime++;\n},\n);\n\nEvery call to $timer->epoch() will then return a time value that is one second ahead of the\nvalue returned on the previous call. This also means that every call to deltamilliseconds()\nwill return a value that exceeds the value returned on the previous call by 1000.\n"
                    }
                ]
            },
            "LICENSE": {
                "content": "Copyright 2002-2013 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Please contribute patches to the project on Github:\n\nhttp://github.com/mschilli/log4perl\n\nSend bug reports or requests for enhancements to the authors via our\n\nMAILING LIST (questions, bug reports, suggestions/patches): log4perl-devel@lists.sourceforge.net\n\nAuthors (please contact them via the list above, not directly): Mike Schilli\n<m@perlmeister.com>, Kevin Goess <cpan@goess.org>\n\nContributors (in alphabetical order): Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp,\nHutton Davidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, Anthony Foiani, James FitzGibbon,\nCarl Franks, Dennis Gregorovic, Andy Grundman, Paul Harrington, Alexander Hartmaier David Hull,\nRobert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter, Brett Rann, Peter Rabbitson, Erik\nSelberg, Aaron Straup Cope, Lars Thegler, David Viner, Mac Yang.\n",
                "subsections": []
            }
        }
    }
}