标签:ram 获取数据 nal final nbsp get sub sys read
ExecutorService executorService = Executors.newSingleThreadExecutor(); Future<String> future = executorService.submit(() -> myJob(param)); try { //设置超时时间 boolean rst = future.get(500, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { System.out.println("任务超时!"); } catch(Exception e){ System.out.println("获取数据异常," + e.getMessage()); }finally { executorService.shutdown(); }
标签:ram 获取数据 nal final nbsp get sub sys read
原文地址:https://www.cnblogs.com/g120/p/14839057.html