<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
               xmlns:atom="http://www.w3.org/2005/Atom"
               xmlns:dc="http://purl.org/dc/elements/1.1/"
               xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
               xmlns:admin="http://webns.net/mvcb/"
               xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
               xmlns:content="http://purl.org/rss/1.0/modules/content/">
            <channel>
                <title>
					                		How to get duration and filament usage on CLI? - PrusaSlicer                                    </title>
                <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/</link>
                <description>Prusa3D Forum Discussion Board</description>
                <language>en-US</language>
                <lastBuildDate>Thu, 14 May 2026 01:47:25 +0000</lastBuildDate>
                <generator>wpForo</generator>
                <ttl>60</ttl>
                					                    <item>
                        <title>RE: How to get duration and filament usage on CLI?</title>
                        <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785852</link>
                        <pubDate>Sat, 14 Mar 2026 20:51:43 +0000</pubDate>
                        <description><![CDATA[interesting, thanks for sharing. my python script now just calls prusa-slicer, then reads those comments. that&#039;s enough for me for now, I&#039;ll keep it in the back of my mind in case I need mor...]]></description>
                        <content:encoded><![CDATA[<p>interesting, thanks for sharing. my python script now just calls prusa-slicer, then reads those comments. that's enough for me for now, I'll keep it in the back of my mind in case I need more gcode related things in my code tho.</p>]]></content:encoded>
                        <category domain="https://forum.prusa3d.com/forum/prusaslicer/">PrusaSlicer</category>                        <dc:creator>Nia</dc:creator>
                        <guid isPermaLink="true">https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785852</guid>
                    </item>
                                        <item>
                        <title>RE:</title>
                        <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785825</link>
                        <pubDate>Sat, 14 Mar 2026 17:31:06 +0000</pubDate>
                        <description><![CDATA[I also did this for my g-code library. There is a function called estimate_print which will return an object that encapsulates time, length and weight. It&#039;s in Python. If not comfortable wit...]]></description>
                        <content:encoded><![CDATA[<p>I also did this for my g-code library. There is a function called estimate_print which will return an object that encapsulates time, length and weight. It's in Python. If not comfortable with Python REPL I could be convinced to create shell script (or PowerShell for Windows)</p>
<pre contenteditable="false">pip install gcode-lib</pre>
<pre contenteditable="false">import gcode_lib as gl

# Load and estimate

 # Works with both binary and ascii gcode
gf = gl.load("my_print.bgcode")

 # auto-detect filament type
est = gl.estimate_print(gf.lines)

print(f"Print time:      {est.time_hms} ({est.time_seconds:.0f}s)")
print(f"Filament length: {est.filament_length_m:.2f} m")
print(f"Filament weight: {est.filament_weight_g:.1f} g")

# Use a different filament type
est = gl.estimate_print(gf.lines, filament_type="PETG")

# Or specify density and diameter directly
est = gl.estimate_print(gf.lines, filament_density=1.27, filament_diameter=1.75)
</pre>
<p> </p>
<p> </p>
<p> </p>]]></content:encoded>
                        <category domain="https://forum.prusa3d.com/forum/prusaslicer/">PrusaSlicer</category>                        <dc:creator>hyiger</dc:creator>
                        <guid isPermaLink="true">https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785825</guid>
                    </item>
                                        <item>
                        <title>RE: How to get duration and filament usage on CLI?</title>
                        <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785680</link>
                        <pubDate>Fri, 13 Mar 2026 16:02:41 +0000</pubDate>
                        <description><![CDATA[Great, thanks. I&#039;ll pull it out of the comments of the gcode file!]]></description>
                        <content:encoded><![CDATA[<p>Great, thanks. I'll pull it out of the comments of the gcode file!</p>]]></content:encoded>
                        <category domain="https://forum.prusa3d.com/forum/prusaslicer/">PrusaSlicer</category>                        <dc:creator>Nia</dc:creator>
                        <guid isPermaLink="true">https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785680</guid>
                    </item>
                                        <item>
                        <title></title>
                        <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785605</link>
                        <pubDate>Fri, 13 Mar 2026 03:33:19 +0000</pubDate>
                        <description><![CDATA[One workaround is to include it in the gcode file name with --output-filename-format(you will need to use --help-fff if you don&#039;t see this in your -help output.)Or, if you want to capture th...]]></description>
                        <content:encoded><![CDATA[<p>One workaround is to include it in the gcode file name with </p><p>--output-filename-format</p><p>(you will need to use --help-fff if you don't see this in your -help output.)</p><p>Or, if you want to capture the info for a database the values are in every text format g-code file in the comment section at the end.  So you could pipe the output file through grep or use a custom post-processing script...</p><p>Cheerio,</p>]]></content:encoded>
                        <category domain="https://forum.prusa3d.com/forum/prusaslicer/">PrusaSlicer</category>                        <dc:creator>Diem</dc:creator>
                        <guid isPermaLink="true">https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785605</guid>
                    </item>
                                        <item>
                        <title>How to get duration and filament usage on CLI?</title>
                        <link>https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785554</link>
                        <pubDate>Thu, 12 Mar 2026 20:32:15 +0000</pubDate>
                        <description><![CDATA[I&#039;m trying to use the prusa-slicer cli interface to generate time and filament usage estimates for a lot of stl files in a big project of mine.I can slice the stl files successfully, but I d...]]></description>
                        <content:encoded><![CDATA[<p>I'm trying to use the prusa-slicer cli interface to generate time and filament usage estimates for a lot of stl files in a big project of mine.</p><p>I can slice the stl files successfully, but I don't see any ways to get the resulting time and filament usage on stdout and didn't spot anything in the help output.</p><p>Any hints?</p>]]></content:encoded>
                        <category domain="https://forum.prusa3d.com/forum/prusaslicer/">PrusaSlicer</category>                        <dc:creator>Nia</dc:creator>
                        <guid isPermaLink="true">https://forum.prusa3d.com/forum/prusaslicer/how-to-get-duration-and-filament-usage-on-cli/#post-785554</guid>
                    </item>
                                                </channel>
        </rss>
        