private void update()
    {
        final ThreadMXBean bean = ManagementFactory.getThreadMXBean();
        final long[] ids = bean.getAllThreadIds();

        for (long id : ids)
        {
            
            if (id == getId())
            {
                continue;
            }

            final long cpuTime = bean.getThreadCpuTime(id);
            final long userTime = bean.getThreadUserTime(id);

            if (cpuTime == -1 || userTime == -1)
            {
                continue;
            }

            ThreadInfo info = cpu.getThread(id);
            
            if (info == null)
            {
                info = cpu.monitor(id).getThreadInfo();
            }
            
            Times times = info.getTimes();
            
            if (times == null)
            {
                times = new Times(id, new Period(cpuTime, cpuTime), new Period(userTime, userTime));
                //info.setTimes(times);
            }
            else
            {
                times.getCpuTime().setEndTime(cpuTime);
                times.getUserTime().setEndTime(userTime);
            }
        }
    }