Wiki source code of Profile of Caleb James DeLisle
Version 11.1 by Caleb James DeLisle on 2013/11/15
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{groovy}} | ||
2 | if (!request.get('loluptime')) { | ||
3 | println('{{include document="XWiki.XWikiUserSheet"/}}') | ||
4 | return; | ||
5 | } | ||
6 | import java.lang.management.ManagementFactory; | ||
7 | long msUp = ManagementFactory.getRuntimeMXBean().getUptime(); | ||
8 | int msMin = 1000*60; | ||
9 | int msHour = msMin*60; | ||
10 | int msDay = msHour*24; | ||
11 | int days = msUp / msDay; | ||
12 | msUp -= days*msDay; | ||
13 | int hours = msUp / msHour; | ||
14 | msUp -= hours*msHour; | ||
15 | int minutes = msUp / msMin; | ||
16 | println("Uptime: " + days + " days, " + hours + " hours and " + minutes + " minutes."); | ||
17 | println("\n\n\n\n\n\n\n\n"); | ||
18 | println('{{html}}<p style="font-size:0.6em">Global variables are bad mmkay</p>{{/html}}'); | ||
19 | {{/groovy}} |