clock_t s = clock();


printf("%d\n", clock() - s);


查资料发现 标准的应该是 Returns the processor time consumed by the program. 返回程序消耗的处理器时间。

但在MSDN上 Calculates the wall-clock time used by the calling process. 计算调用进程使用的挂钟时间,

注释写的是  The clock function tells how much wall-clock time has passed since the CRT initialization during process start. Note that this function does not strictly conform to ISO C, which specifies net CPU time as the return value. To obtain CPU times, use the Win32 GetProcessTimes function. To determine the elapsed time in seconds, divide the value returned by the clock function by the macro CLOCKS_PER_SEC. 



OPENSSL AES解密文件遇到的一个小坑

    openssl aes解密需要用到 EVP_CIPHER_CTX_new EVP_DecryptInit_ex EVP_DecryptUpdate EVP_DecryptFinal_ex EVP_CIPHER_CTX_free 五个函数。



EVP_DecryptInit_ex(), EVP_DecryptUpdate() and EVP_DecryptFinal_ex() are the corresponding decryption operations. EVP_DecryptFinal() will return an error code if padding is enabled and the final block is not correctly formatted. The parameters and restrictions are identical to the encryption operations except that if padding is enabled the decrypted data buffer out passed to EVP_DecryptUpdate() should have sufficient room for (inl + cipher_block_size) bytes unless the cipher block size is 1 in which case inl bytes is sufficient.