Re: need help in mcrypt library

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am not sure , but I think you want to have the last time calculated after the if itslef and also microtime .

Else I think In your code it may varies according to the rendering of html . 

See an example 

<?php

// Test Source
function Test5_1() {

    /* The Test */
    $t = microtime(true);
    for($i = 0; $i < 1000000; ++$i);

    return (microtime(true) - $t);
}

?>


 Hari K T

http://harikt.com/





________________________________
From: Uzair <uzair05csmehran@xxxxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Sat, 27 February, 2010 6:53:25 PM
Subject:  need help in mcrypt library

  
hiiiii
i want to calculate the time of php for encrypting a file of 10 MB using 3DES method.
I implemented the code successfully.
But unable to calculate the correct time because whenever  i execute the page its gives different times in seconds as 10 sec or some time 24 seconds.
Kindly help meeeeee
this is code tested in xamp 1.7.2

<?php
$timestart=time( ); 

$file = 'textfile.txt' ;
$initial_contents = file_get_contents( $file); 

if($initial_ contents) {

$key = "this key";
$encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key,  $initial_contents, MCRYPT_ENCRYPT) ;

}

?> 
<table width="1120" align="center" bgcolor="#ffffff" border="0" valign="top" cellspacing= "0" cellpadding= "0">
<tr><td>&nbsp; &nbsp;&nbsp; <?php echo time()-$timestart;  ?></td></tr> </table>


 


      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. http://in.yahoo.com/

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux