From 780d9fdb11082ff89e90db9104c1928491b8a078 Mon Sep 17 00:00:00 2001 From: guanjihuan Date: Thu, 27 Feb 2025 17:46:30 +0800 Subject: [PATCH] 0.1.152 --- PyPI/setup.cfg | 2 +- PyPI/src/guan.egg-info/PKG-INFO | 2 +- PyPI/src/guan/data_processing.py | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 7a27b7e..7c3f7b5 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -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 diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index a5cf131..5050528 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -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 diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index ba941e4..47fb7f9 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -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