代码片段 -- Java计算代码执行消耗时间

long l1 = System.currentTimeMillis();

				Map<Integer, String> recipients = new HashMap<Integer, String>();
				Integer groupId = taskInst.getGroupId();
				Group group = groupManager.getGroupById(groupId);
				taskInst.setGroupName(group.getName());

				List<UserGroup> userGroups = userGroupManager
						.getListByGroupId(groupId);
				for (UserGroup userGroup : userGroups) {
					User user = userManager.getUser(userGroup.getUserId());
					recipients.put(user.getId(), user.getFullName());
				}
				long l2 = System.currentTimeMillis();

				System.out.println(l2 - l1);

你可能感兴趣的:(java,String,user,Integer)