Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static long convertDelayString(String delay){
- long time = 0L;
- int multiplier = 0;
- int base = 1;
- byte[] chars = delay.toLowerCase().getBytes();
- byte num = 0;
- for(int i = chars.length-1; i >= 0; i--){
- if(((num=(byte)(chars[i]^0x30))&0xF0)==0){
- time += num * multiplier * base;
- base *= 0x0A;
- continue;
- }else if(chars[i] == 'h')
- multiplier = 0x36EE80;
- else if(chars[i] == 'm')
- multiplier = 0xEA60;
- else if(chars[i] == 's')
- multiplier = 0x3E8;
- else
- continue;
- base = 1;
- }
- return time;
- }
Add Comment
Please, Sign In to add comment