how to get the using time when runing a command?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
linjuming
Posts: 122
Joined: 2011-01-25T00:09:50-07:00
Authentication code: 8675308

how to get the using time when runing a command?

Post by linjuming »

how to get the using time when runing a command?

such as ,I wan to know:

Code: Select all

convert -size 1000x1000 xc:white white.png
convert white.png -resize: 1000x1000 white.png
or use imagick php code to do that
which is faster,how to get the using time?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: how to get the using time when runing a command?

Post by anthony »

try using time command

Code: Select all

   time convert rose: null

real    0m0.011s
user    0m0.002s
sys     0m0.009s
taht is 0.011 second overall. but only .002 for the actual command, rather than kernel processing
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: how to get the using time when runing a command?

Post by fmw42 »

on unix/mac you can use time function

time convert -size 1000x1000 xc:white white.png
time convert white.png -resize: 1000x1000 white.png

or


time convert -size 1000x1000 xc:white PNG:- | convert - white.png -resize: 1000x1000 white.png

or faster


time convert -size 1000x1000 xc:white MIFF:- | convert - white.png -resize: 1000x1000 white.png

or faster yet

time convert -size 1000x1000 xc:white -resize: 1000x1000 white.png

or since the image is constant, then use -scale or -sample rather than -resize and it will be even faster.

or just create it the final size

time convert -size 1000000x1000000 xc:white white.png
Last edited by fmw42 on 2011-03-16T21:35:45-07:00, edited 3 times in total.
linjuming
Posts: 122
Joined: 2011-01-25T00:09:50-07:00
Authentication code: 8675308

Re: how to get the using time when runing a command?

Post by linjuming »

thanks ,help much!
Post Reply