From e88c04431d06edd05a5cb4eaff5bc120ff063224 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 20 八月 2025 15:13:02 +0800
Subject: [PATCH] 格式化浮点数为两位小数
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 157 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java
new file mode 100644
index 0000000..37eec13
--- /dev/null
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/threadPool/Test.java
@@ -0,0 +1,157 @@
+package com.dy.common.threadPool;
+
+
+public class Test {
+
+//
+// public static void main(String args[])throws Exception {
+//// Test t = new Test();
+//// t.testShort1();
+//// t.testShort2();
+//// t.testLong();
+// }
+
+ /**
+ * 娴嬭瘯澧炲姞绾跨▼绾跨▼
+ * @throws Exception
+ *
+ */
+ @SuppressWarnings("unused")
+ private void testShort1() throws Exception {
+ TreadPoolFactory.initThreadPoolShort("娴嬭瘯绾跨▼缁�", 2, 1, 10, 20);
+ ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolShort() ;
+ try {
+ int n = 1 ;
+ Thread.sleep(1000);
+ while (n < 4) {
+ System.out.println("鍔犲叆鐭伐浣滀换鍔�(" + n + ")");
+ pool.putJob(new ThreadPool.Job() {
+ public void execute() {
+ System.out.println("!!!!!寮�濮嬬煭宸ヤ綔" + this.hashCode());
+ try {
+ Thread.sleep(2000);
+ } catch (Exception e) {
+ ;
+ }
+ System.out.println("!!!!!缁撴潫鐭伐浣�" + this.hashCode());
+ }
+ @Override
+ public void destroy(){
+ }
+ @Override
+ public boolean isDestroy(){
+ return false ;
+ }
+ });
+ n++ ;
+ Thread.sleep(100);
+ }
+ } catch (Exception e) {
+
+ }
+ }
+ /**
+ * 娴嬭瘯澧炲姞绾跨▼绾跨▼
+ * @throws Exception
+ *
+ */
+ @SuppressWarnings("unused")
+ private void testShort2() throws Exception {
+ TreadPoolFactory.initThreadPoolShort("娴嬭瘯鐭伐浣滅嚎绋嬬粍", 2, 1, 5, 6);
+ ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolShort() ;
+ try {
+ int n = 1 ;
+ Thread.sleep(1000);
+ while (n < 2) {
+ System.out.println("鍔犲叆鐭伐浣滀换鍔�(" + n + ")");
+ pool.putJob(new ThreadPool.Job() {
+ @Override
+ public void execute() {
+ Long times = 0L ;
+ System.out.println("!!!!!寮�濮嬬煭宸ヤ綔" + this.hashCode());
+ while(true){
+ if(this.isDestroy == null || !this.isDestroy.booleanValue()){
+ times++ ;
+ System.out.println("!!!!!鎵ц鐭伐浣�" + this.hashCode() + " 娆℃暟锛�" + times);
+ try {
+ Thread.sleep(2000);
+ } catch (Exception e) {
+ ;
+ }
+// System.out.println("!!!!!缁撴潫闀垮伐浣�" + this.hashCode());
+ }
+ }
+ }
+ @Override
+ public void destroy(){
+ this.isDestroy = true ;
+ }
+ @Override
+ public boolean isDestroy(){
+ if(this.isDestroy == null){
+ return false ;
+ }
+ return this.isDestroy.booleanValue() ;
+ }
+ private Boolean isDestroy;
+ });
+ n++ ;
+ Thread.sleep(100);
+ }
+ } catch (Exception e) {
+
+ }
+ }/**
+ * 娴嬭瘯澧炲姞绾跨▼绾跨▼
+ * @throws Exception
+ *
+ */
+ @SuppressWarnings("unused")
+ private void testLong() throws Exception {
+ TreadPoolFactory.initThreadPoolLong("娴嬭瘯闀垮伐浣滅嚎绋嬬粍", -1, 1, 5, -1);
+ ThreadPool.Pool pool = TreadPoolFactory.getThreadPoolLong() ;
+ try {
+ int n = 1 ;
+ Thread.sleep(1000);
+ while (n < 2) {
+ System.out.println("鍔犲叆闀垮伐浣滀换鍔�(" + n + ")");
+ pool.putJob(new ThreadPool.Job() {
+ @Override
+ public void execute() {
+ Long times = 0L ;
+ System.out.println("!!!!!寮�濮嬮暱宸ヤ綔" + this.hashCode());
+ while(true){
+ if(this.isDestroy == null || !this.isDestroy.booleanValue()){
+ times++ ;
+ System.out.println("!!!!!鎵ц闀垮伐浣�" + this.hashCode() + " 娆℃暟锛�" + times);
+ try {
+ Thread.sleep(2000);
+ } catch (Exception e) {
+ ;
+ }
+// System.out.println("!!!!!缁撴潫闀垮伐浣�" + this.hashCode());
+ }
+ }
+ }
+ @Override
+ public void destroy(){
+ this.isDestroy = true ;
+ }
+ @Override
+ public boolean isDestroy(){
+ if(this.isDestroy == null){
+ return false ;
+ }
+ return this.isDestroy.booleanValue() ;
+ }
+ private Boolean isDestroy;
+ });
+ n++ ;
+ Thread.sleep(100);
+ }
+ } catch (Exception e) {
+
+ }
+ }
+
+}
--
Gitblit v1.8.0