This commit is contained in:
guanjihuan 2025-02-27 17:46:30 +08:00
parent 0dc4255549
commit 780d9fdb11
3 changed files with 15 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[metadata]
# replace with your username:
name = guan
version = 0.1.151
version = 0.1.152
author = guanjihuan
author_email = guanjihuan@163.com
description = An open source python package

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.2
Name: guan
Version: 0.1.151
Version: 0.1.152
Summary: An open source python package
Home-page: https://py.guanjihuan.com
Author: guanjihuan

View File

@ -96,6 +96,19 @@ def dimension_of_array(array):
dim = array.shape[0]
return dim
# CPU性能测试十亿次循环的浮点加法运算的时间约30秒左右
def cpu_test_with_addition(print_show=1):
import time
result = 0.0
start_time = time.time()
for _ in range(int(1e9)):
result += 1e-9
end_time = time.time()
run_time = end_time - start_time
if print_show:
print(run_time)
return run_time
# 将XYZ数据转成矩阵数据说明x_array/y_array的输入和输出不一样。要求z_array数据中y对应的数据为小循环x对应的数据为大循环
def convert_xyz_data_into_matrix_data(x_array, y_array, z_array):
import numpy as np